INNER CODE UNIT · Python
handle_403
giuseppe99barchetta/SuggestArr · api_service/app.py:159
def handle_403(exc):
return jsonify({"error": "Insufficient permissions"}), 403
@application.errorhandler(404)
def handle_404(exc):
return jsonify({"error": "Not found"}), 404
@application.errorhandler(429)
def handle_429(exc):
return jsonify({"error": "Too many requests — please try again later"}), 429
@application.errorhandler(500)
def handle_500(exc):
logger.error("Unhandled internal error: %s", exc, exc_info=True)
return jsonify({"error": "Internal server error"}), 500
# ------------------------------------------------------------------
# Blueprint registration