Răsfoiți Sursa

RPCError: include the exception args we get from remote

Without this, you just got "RCPError: AttributeError", now you get (e.g.):

RPCError: AttributeError(b"'Repository' object has no attribute 'segments'",)
Thomas Waldmann 10 ani în urmă
părinte
comite
954b26f64c
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      attic/remote.py

+ 2 - 2
attic/remote.py

@@ -157,7 +157,7 @@ class RemoteRepository(object):
                             raise PathNotAllowed(*res)
                             raise PathNotAllowed(*res)
                         if error == b'ObjectNotFound':
                         if error == b'ObjectNotFound':
                             raise Repository.ObjectNotFound(res[0], self.location.orig)
                             raise Repository.ObjectNotFound(res[0], self.location.orig)
-                        raise self.RPCError(error)
+                        raise self.RPCError("%s%r" % (error.decode('ascii'), res))
                     else:
                     else:
                         yield res
                         yield res
                         if not waiting_for and not calls:
                         if not waiting_for and not calls:
@@ -312,4 +312,4 @@ class RepositoryCache:
 def cache_if_remote(repository):
 def cache_if_remote(repository):
     if isinstance(repository, RemoteRepository):
     if isinstance(repository, RemoteRepository):
         return RepositoryCache(repository)
         return RepositoryCache(repository)
-    return repository
+    return repository