def METHOD_NAME(f, *args, **kwargs):
    try:
        response = f(*args, **kwargs)
    except HTTPException as e:
        data = {"error": str(e), "description": e.description}
        return jsonify(data), e.code
    except Exception as e:
        app.logger.exception("Exception during json request: %r", e)
        data = {"error": e.__class__.__name__, "description": str(e)}
        return jsonify(data), 500
    else:
        if isinstance(response, (app.response_class, Response)):
            return response
        return jsonify(response), 200