Convert not implemented errors.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 6 Dec 2007 19:18:12 +0000 (20:18 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 6 Dec 2007 19:18:12 +0000 (20:18 +0100)
errors.py
tests/test_errors.py

index 60e9d9f1227e3c8f53b8e0b3fa8333641a562c7a..99c6d51c0368b6cc1ab6b9e5abb281039e5ecc05 100644 (file)
--- a/errors.py
+++ b/errors.py
@@ -80,6 +80,8 @@ def convert_error(err):
         return UnexpectedEndOfContainerError()
     elif num == svn.core.SVN_ERR_RA_SVN_MALFORMED_DATA:
         return TransportError("Malformed data", msg)
+    elif num == svn.core.SVN_ERR_RA_NOT_IMPLEMENTED:
+        return NotImplementedError("Function not implemented in remote server")
     elif num == SVN_ERR_UNKNOWN_HOSTNAME:
         return ConnectionError(msg=msg)
     elif num > 0 and num < 1000:
index 8bc2191de7066234aee0ab4bcf74a7c29a8470e4..1db6ad407309d1c7ac5cca1755f1bf51e79775f9 100644 (file)
@@ -66,6 +66,9 @@ class TestConvertError(TestCase):
     def test_convert_unknown_hostname(self):
         self.assertIsInstance(convert_error(SubversionException("Unknown hostname 'bla'", SVN_ERR_UNKNOWN_HOSTNAME)), ConnectionError)
 
+    def test_not_implemented(self):
+        self.assertIsInstance(convert_error(SubversionException("Remote server doesn't support ...", svn.core.SVN_ERR_RA_NOT_IMPLEMENTED)), NotImplementedError)
+
     def test_decorator_nothrow(self):
         @convert_svn_error
         def test_nothrow(foo):