-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
error_trace
to string representation of an Error
If the `error_trace` payload is available, add it to the string representation of the Error class.
- Loading branch information
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import unittest | ||
|
||
from crate.client import Error | ||
|
||
|
||
class ErrorTestCase(unittest.TestCase): | ||
|
||
def test_error_with_msg(self): | ||
err = Error("foo") | ||
self.assertEqual(str(err), "foo") | ||
|
||
def test_error_with_error_trace(self): | ||
err = Error("foo", error_trace="### TRACE ###") | ||
self.assertEqual(str(err), "foo\n### TRACE ###") |