@@ -20,7 +20,10 @@ def _register_error_handlers(application: Flask) -> None:
2020 This function will register all the error handlers for the application
2121
2222 :param application: The Flask application to register the error handlers
23+ :type application: flask.Flask
24+
2325 :return: None
26+ :rtype: None
2427
2528 .. versionchanged:: 0.5.0
2629 Made the function private. If you want to register the custom error handlers, you need to
@@ -50,7 +53,10 @@ def generate_badrequest(error: BadRequestError) -> Response:
5053 a custom message and the 400 code
5154
5255 :param error: The error body
56+ :type error: BadRequestError
57+
5358 :return: Returns the response formatted
59+ :rtype: flask.Response
5460 """
5561 return _generate_error_json (error , 400 )
5662
@@ -61,7 +67,10 @@ def generate_conflict(error: ConflictError) -> Response:
6167 a custom message and the 409 code
6268
6369 :param error: The error body
70+ :type error: ConflictError
71+
6472 :return: Returns the response formatted
73+ :rtype: flask.Response
6574 """
6675
6776 return _generate_error_json (error , 409 )
@@ -73,7 +82,10 @@ def generate_forbidden(error: ForbiddenError) -> Response:
7382 a custom message and the 403 code
7483
7584 :param error: The error body
85+ :type error: ForbiddenError
86+
7687 :return: Returns the response formatted
88+ :rtype: flask.Response
7789 """
7890
7991 return _generate_error_json (error , 403 )
@@ -85,7 +97,10 @@ def generate_notfound(error: NotFoundError) -> Response:
8597 a custom message and the 404 code.
8698
8799 :param error: The error body
100+ :type error: NotFoundError
101+
88102 :return: Returns the response formatted
103+ :rtype: flask.Response
89104 """
90105
91106 return _generate_error_json (error , 404 )
@@ -97,7 +112,10 @@ def generate_unauthorized(error: UnauthorizedError) -> Response:
97112 a custom message and the 401 code.
98113
99114 :param error: The error body
115+ :type error: UnauthorizedError
116+
100117 :return: Returns the response formatted
118+ :rtype: flask.Response
101119 """
102120
103121 return _generate_error_json (error , 401 )
@@ -109,7 +127,10 @@ def generate_origin_is_unreachable(error: OriginIsUnreachableError) -> Response:
109127 a custom message and the 523 code.
110128
111129 :param error: The error body
130+ :type error: OriginIsUnreachableError
131+
112132 :return: Returns the response formatted
133+ :rtype: flask.Response
113134 """
114135
115136 return _generate_error_json (error , 523 )
@@ -121,7 +142,10 @@ def generate_web_server_is_down(error: WebServerIsDownError) -> Response:
121142 a custom message and the 521 code.
122143
123144 :param error: The error body
145+ :type error: WebServerIsDownError
146+
124147 :return: Returns the response formatted
148+ :rtype: flask.Response
125149 """
126150
127151 return _generate_error_json (error , 521 )
@@ -133,7 +157,10 @@ def generate_failed_dependency(error: FailedDependencyError) -> Response:
133157 a custom message and the 424 code.
134158
135159 :param error: The error body
160+ :type error: FailedDependencyError
161+
136162 :return: Returns the response formatted
163+ :rtype: flask.Response
137164 """
138165
139166 return _generate_error_json (error , 424 )
@@ -145,7 +172,10 @@ def generate_gone(error: GoneError) -> Response:
145172 a custom message and the 410 code.
146173
147174 :param error: The error body
175+ :type error: GoneError
176+
148177 :return: Returns the response formatted
178+ :rtype: flask.Response
149179 """
150180
151181 return _generate_error_json (error , 410 )
@@ -157,7 +187,10 @@ def generate_unprocessable_entity(error: UnprocessableEntityError) -> Response:
157187 a custom message and the 422 code.
158188
159189 :param error: The error body
190+ :type error: UnprocessableEntityError
191+
160192 :return: Returns the response formatted
193+ :rtype: flask.Response
161194 """
162195
163196 return _generate_error_json (error , 422 )
@@ -169,7 +202,10 @@ def generate_service_unavailable(error: ServiceUnavailableError) -> Response:
169202 a custom message and the 503 code.
170203
171204 :param error: The error body
205+ :type error: ServiceUnavailableError
206+
172207 :return: Returns the response formatted
208+ :rtype: flask.Response
173209 """
174210
175211 return _generate_error_json (error , 503 )
0 commit comments