Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix typo
  • Loading branch information
eduardisrael committed Apr 9, 2021
commit c13ace6cc30b332e9b7d8968eddea46ceb8751d2
14 changes: 7 additions & 7 deletions time_tracker_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,6 @@ def handle_not_found_errors(error):
return {'message': 'It was not found'}, HTTPStatus.NOT_FOUND


@api.errorhandler(CosmosClientTimeoutError)
@api.errorhandler(StopIteration)
def handle_not_found_errors(error):
app.logger.error(error)
return {'message': 'No Content'}, HTTPStatus.NO_CONTENT


@api.errorhandler(CosmosHttpResponseError)
def handle_cosmos_http_response_error(error):
app.logger.error(error)
Expand Down Expand Up @@ -180,3 +173,10 @@ def default_error_handler(error):
{'message': 'An unhandled exception occurred.'},
HTTPStatus.INTERNAL_SERVER_ERROR,
)


@api.errorhandler(CosmosClientTimeoutError)
@api.errorhandler(StopIteration)
def handle_no_content(error):
app.logger.error(error)
return {'message': 'No Content'}, HTTPStatus.NO_CONTENT