def exception_log_and_respond(exception, logger, message, status_code):
    """Log an error and send jsonified respond."""
    logger.error(message, exc_info=True)
    return make_response(
        message,
        status_code,
        dict(exception_type=type(exception).__name__, exception_message=str(exception)),
    )
Log an error and send jsonified respond.