def METHOD_NAME(error):
    stacktrace = traceback.format_exc()
    current_app.logger.error(stacktrace)
    return (
        jsonify(error=True, message=str(error), stacktrace=stacktrace),
        500,
    )