diff options
-rw-r--r-- | gsxws/core.py | 3 | ||||
-rw-r--r-- | tests/test_gsxws.py | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gsxws/core.py b/gsxws/core.py index 8fba5b5..5c771af 100644 --- a/gsxws/core.py +++ b/gsxws/core.py @@ -150,6 +150,9 @@ class GsxError(Exception): self.codes = [] self.messages = [] + if isinstance(message, basestring): + self.messages.append(message) + if xml is not None: logging.debug(url) logging.debug(xml) diff --git a/tests/test_gsxws.py b/tests/test_gsxws.py index 868a853..e59c1ff 100644 --- a/tests/test_gsxws.py +++ b/tests/test_gsxws.py @@ -41,6 +41,11 @@ class TestErrorFunctions(TestCase): def test_message(self): self.assertRegexpMatches(self.data.message, 'Multiple error messages exist.') + def test_exception(self): + msg = 'Connection failed' + e = GsxError(msg) + self.assertEqual(e.message, msg) + class TestLookupFunctions(RemoteTestCase): def test_component_check(self): |