@@ -45,72 +45,72 @@ def bad_request(error):
45
45
)
46
46
47
47
48
- @app .errorhandler (status .HTTP_404_NOT_FOUND )
49
- def not_found (error ):
50
- """Handles resources not found with 404_NOT_FOUND"""
51
- message = str (error )
52
- app .logger .warning (message )
53
- return (
54
- jsonify (status = status .HTTP_404_NOT_FOUND , error = "Not Found" , message = message ),
55
- status .HTTP_404_NOT_FOUND ,
56
- )
48
+ # @app.errorhandler(status.HTTP_404_NOT_FOUND)
49
+ # def not_found(error):
50
+ # """Handles resources not found with 404_NOT_FOUND"""
51
+ # message = str(error)
52
+ # app.logger.warning(message)
53
+ # return (
54
+ # jsonify(status=status.HTTP_404_NOT_FOUND, error="Not Found", message=message),
55
+ # status.HTTP_404_NOT_FOUND,
56
+ # )
57
57
58
58
59
- @app .errorhandler (status .HTTP_405_METHOD_NOT_ALLOWED )
60
- def method_not_supported (error ):
61
- """Handles unsupported HTTP methods with 405_METHOD_NOT_SUPPORTED"""
62
- message = str (error )
63
- app .logger .warning (message )
64
- return (
65
- jsonify (
66
- status = status .HTTP_405_METHOD_NOT_ALLOWED ,
67
- error = "Method not Allowed" ,
68
- message = message ,
69
- ),
70
- status .HTTP_405_METHOD_NOT_ALLOWED ,
71
- )
59
+ # @app.errorhandler(status.HTTP_405_METHOD_NOT_ALLOWED)
60
+ # def method_not_supported(error):
61
+ # """Handles unsupported HTTP methods with 405_METHOD_NOT_SUPPORTED"""
62
+ # message = str(error)
63
+ # app.logger.warning(message)
64
+ # return (
65
+ # jsonify(
66
+ # status=status.HTTP_405_METHOD_NOT_ALLOWED,
67
+ # error="Method not Allowed",
68
+ # message=message,
69
+ # ),
70
+ # status.HTTP_405_METHOD_NOT_ALLOWED,
71
+ # )
72
72
73
73
74
- @app .errorhandler (status .HTTP_409_CONFLICT )
75
- def resource_conflict (error ):
76
- """Handles resource conflicts with HTTP_409_CONFLICT"""
77
- message = str (error )
78
- app .logger .warning (message )
79
- return (
80
- jsonify (
81
- status = status .HTTP_409_CONFLICT ,
82
- error = "Conflict" ,
83
- message = message ,
84
- ),
85
- status .HTTP_409_CONFLICT ,
86
- )
74
+ # @app.errorhandler(status.HTTP_409_CONFLICT)
75
+ # def resource_conflict(error):
76
+ # """Handles resource conflicts with HTTP_409_CONFLICT"""
77
+ # message = str(error)
78
+ # app.logger.warning(message)
79
+ # return (
80
+ # jsonify(
81
+ # status=status.HTTP_409_CONFLICT,
82
+ # error="Conflict",
83
+ # message=message,
84
+ # ),
85
+ # status.HTTP_409_CONFLICT,
86
+ # )
87
87
88
88
89
- @app .errorhandler (status .HTTP_415_UNSUPPORTED_MEDIA_TYPE )
90
- def mediatype_not_supported (error ):
91
- """Handles unsupported media requests with 415_UNSUPPORTED_MEDIA_TYPE"""
92
- message = str (error )
93
- app .logger .warning (message )
94
- return (
95
- jsonify (
96
- status = status .HTTP_415_UNSUPPORTED_MEDIA_TYPE ,
97
- error = "Unsupported media type" ,
98
- message = message ,
99
- ),
100
- status .HTTP_415_UNSUPPORTED_MEDIA_TYPE ,
101
- )
89
+ # @app.errorhandler(status.HTTP_415_UNSUPPORTED_MEDIA_TYPE)
90
+ # def mediatype_not_supported(error):
91
+ # """Handles unsupported media requests with 415_UNSUPPORTED_MEDIA_TYPE"""
92
+ # message = str(error)
93
+ # app.logger.warning(message)
94
+ # return (
95
+ # jsonify(
96
+ # status=status.HTTP_415_UNSUPPORTED_MEDIA_TYPE,
97
+ # error="Unsupported media type",
98
+ # message=message,
99
+ # ),
100
+ # status.HTTP_415_UNSUPPORTED_MEDIA_TYPE,
101
+ # )
102
102
103
103
104
- @app .errorhandler (status .HTTP_500_INTERNAL_SERVER_ERROR )
105
- def internal_server_error (error ):
106
- """Handles unexpected server error with 500_SERVER_ERROR"""
107
- message = str (error )
108
- app .logger .error (message )
109
- return (
110
- jsonify (
111
- status = status .HTTP_500_INTERNAL_SERVER_ERROR ,
112
- error = "Internal Server Error" ,
113
- message = message ,
114
- ),
115
- status .HTTP_500_INTERNAL_SERVER_ERROR ,
116
- )
104
+ # @app.errorhandler(status.HTTP_500_INTERNAL_SERVER_ERROR)
105
+ # def internal_server_error(error):
106
+ # """Handles unexpected server error with 500_SERVER_ERROR"""
107
+ # message = str(error)
108
+ # app.logger.error(message)
109
+ # return (
110
+ # jsonify(
111
+ # status=status.HTTP_500_INTERNAL_SERVER_ERROR,
112
+ # error="Internal Server Error",
113
+ # message=message,
114
+ # ),
115
+ # status.HTTP_500_INTERNAL_SERVER_ERROR,
116
+ # )
0 commit comments