Skip to content

Commit

Permalink
Fix write_error for raise HTTPError(code, message)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkykh committed May 20, 2019
1 parent 489de95 commit 91140e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions medusa/server/api/v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ def write_error(self, status_code, *args, **kwargs):
exc_info = kwargs.get('exc_info', None)

if exc_info and isinstance(exc_info[1], HTTPError):
error = exc_info[1]
response = self.api_response(status=status_code, error=error.reason)
error = exc_info[1].log_message or exc_info[1].reason
response = self.api_response(status=status_code, error=error)
elif app.DEVELOPER and exc_info:
self.set_header('content-type', 'text/plain')
self.set_status(500)
Expand Down

0 comments on commit 91140e1

Please sign in to comment.