Rev 1510: Handle RA_DAV_REQUEST_FAILED errors explicitly. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Fri Aug 1 22:39:56 BST 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/trunk

------------------------------------------------------------
revno: 1510
revision-id: jelmer at samba.org-20080801213954-ei7vahx4tomdozj4
parent: jelmer at samba.org-20080801212036-7e5zucbdmk916zpv
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Fri 2008-08-01 23:39:54 +0200
message:
  Handle RA_DAV_REQUEST_FAILED errors explicitly.
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  errors.py                      errors.py-20061226172623-w1sbj8ynpo0eojqp-1
  tests/test_errors.py           test_errors.py-20070129114605-ban03f32t6ja14ez-1
=== modified file 'NEWS'
--- a/NEWS	2008-07-28 22:55:52 +0000
+++ b/NEWS	2008-08-01 21:39:54 +0000
@@ -106,6 +106,10 @@
 
    * Stricter checking of special files for links. (#219832)
 
+   * Avoid showing backtrace for RA_DAV_REQUEST_FAILED errors, since 
+     they may be raised in other situations than when a bug is hit.
+	 (#253376)
+
 bzr-svn 0.4.10  2008-05-12
 
   CHANGES

=== modified file 'errors.py'
--- a/errors.py	2008-07-09 02:44:05 +0000
+++ b/errors.py	2008-08-01 21:39:54 +0000
@@ -93,6 +93,14 @@
         self.path = path
 
 
+class RaRequestFailed(BzrError):
+    _fmt = """A Subversion remote access command failed: %(message)"""
+
+    def __init__(self, message):
+        BzrError.__init__(self)
+        self.mesage = message
+
+
 class RevpropChangeFailed(BzrError):
     _fmt = """Unable to set revision property %(name)s."""
 
@@ -121,6 +129,8 @@
         return TransportError("Malformed data", msg)
     elif num == ERR_RA_NOT_IMPLEMENTED:
         return NotImplementedError("Function not implemented in remote server")
+    elif num == ERR_RA_DAV_REQUEST_FAILED:
+        return RaRequestFailed(msg)
     elif num == ERR_UNKNOWN_HOSTNAME:
         return ConnectionError(msg=msg)
     elif num > 0 and num < 1000:

=== modified file 'tests/test_errors.py'
--- a/tests/test_errors.py	2008-06-22 08:45:53 +0000
+++ b/tests/test_errors.py	2008-08-01 21:39:54 +0000
@@ -45,6 +45,9 @@
         self.assertIsInstance(convert_error(SubversionException("foo", -4)),
                 SubversionException)
 
+    def test_convert_ra_request_failed(self):
+        self.assertIsInstance(convert_error(SubversionException("foo", ERR_RA_DAV_REQUEST_FAILED)), RaRequestFailed)
+
     def test_convert_malformed(self):
         self.assertIsInstance(convert_error(SubversionException("foo", ERR_RA_SVN_MALFORMED_DATA)), TransportError)
 




More information about the bazaar-commits mailing list