Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Log OMPS errors
Browse files Browse the repository at this point in the history
Instead of just returning OMPS errors to client, we should also log what
happened in case that client just dropped content of message.

Signed-off-by: Martin Bašti <mbasti@redhat.com>
  • Loading branch information
MartinBasti authored and csomh committed Sep 10, 2019
1 parent 2017735 commit 18d37c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion omps/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,12 @@ def init_errors_handling(app):
@app.errorhandler(OMPSError)
def omps_errors(e):
"""Handle OMPS application errors"""
response = jsonify(e.to_dict())
err_dict = e.to_dict()
app.logger.error(
'OMPS error: %s: %r',
err_dict['error'], err_dict
)
response = jsonify(err_dict)
response.status_code = e.code
return response

Expand Down

0 comments on commit 18d37c2

Please sign in to comment.