Skip to content

Commit

Permalink
Bugfix: Return proper error (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
avinassh authored Dec 19, 2020
1 parent 754a4f1 commit cdca925
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions twirp/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

class TwirpServerException(httplib.HTTPException):
def __init__(self, *args, code, message, meta={}):
if isinstance(code, errors.Errors):
self._code = code
else:
try:
self._code = errors.Errors(code)
except ValueError:
self._code = errors.Errors.Unknown
self._message = message
self._meta = meta
Expand Down

0 comments on commit cdca925

Please sign in to comment.