Skip to content

Commit

Permalink
Add error_trace to string representation of an Error
Browse files Browse the repository at this point in the history
If the `error_trace` payload is available, add it to the string
representation of the Error class.
  • Loading branch information
seut committed Oct 2, 2024
1 parent 1456de0 commit 952b75f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/crate/client/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def __init__(self, msg=None, error_trace=None):
super(Error, self).__init__(msg)
self.error_trace = error_trace

def __str__(self):
if self.error_trace is None:
return super().__str__()
return super().__str__() + str(self.error_trace)

class Warning(Exception):
pass
Expand Down

0 comments on commit 952b75f

Please sign in to comment.