Skip to content

Commit

Permalink
Merge pull request #190 from bento-platform/feat/responses/method-not…
Browse files Browse the repository at this point in the history
…-allowed

feat(responses): add method not allowed error
  • Loading branch information
davidlougheed authored Apr 15, 2024
2 parents 6893944 + 6277031 commit 5570243
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 171 deletions.
2 changes: 2 additions & 0 deletions bento_lib/responses/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"unauthorized_error",
"forbidden_error",
"not_found_error",
"method_not_allowed_error",
"not_acceptable_error",
"request_timeout_error",
"range_not_satisfiable_error",
Expand Down Expand Up @@ -90,6 +91,7 @@ def http_error(
unauthorized_error = _e(401)
forbidden_error = _e(403)
not_found_error = _e(404)
method_not_allowed_error = _e(405)
not_acceptable_error = _e(406)
request_timeout_error = _e(408)
range_not_satisfiable_error = _e(416)
Expand Down
2 changes: 2 additions & 0 deletions bento_lib/responses/flask_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"flask_unauthorized_error",
"flask_forbidden_error",
"flask_not_found_error",
"flask_method_not_allowed_error",
"flask_not_acceptable_error",
"flask_request_timeout_error",
"flask_range_not_satisfiable_error",
Expand Down Expand Up @@ -88,6 +89,7 @@ def _flask_error(code: int) -> Callable:
flask_unauthorized_error = _flask_error(401)
flask_forbidden_error = _flask_error(403)
flask_not_found_error = _flask_error(404)
flask_method_not_allowed_error = _flask_error(405)
flask_not_acceptable_error = _flask_error(406)
flask_request_timeout_error = _flask_error(408)
flask_range_not_satisfiable_error = _flask_error(416)
Expand Down
Loading

0 comments on commit 5570243

Please sign in to comment.