def METHOD_NAME(exception: Exception):
    """Handle an unexpected exception."""
    LOGGER.critical("Unexpected exception: %s", exception, exc_info=True)
    response = jsonify(exception_message(exception))
    response.status_code = 500
    return response