Remote: don't print tracebacks for Error exceptions handled downstream

(What we'd really want is to have proper exception transporting over
 the RPC)

Fixes #792
This commit is contained in:
Marian Beermann 2016-04-04 17:09:52 +02:00
parent bf208479d7
commit 425a4d819d
1 changed files with 6 additions and 2 deletions

View File

@ -93,6 +93,10 @@ class RepositoryServer: # pragma: no cover
f = getattr(self.repository, method) f = getattr(self.repository, method)
res = f(*args) res = f(*args)
except BaseException as e: except BaseException as e:
# These exceptions are reconstructed on the client end in RemoteRepository.call_many(),
# and will be handled just like locally raised exceptions. Suppress the remote traceback
# for these, except ErrorWithTraceback, which should always display a traceback.
if not isinstance(e, (Repository.DoesNotExist, Repository.AlreadyExists, PathNotAllowed)):
logging.exception('Borg %s: exception in RPC call:', __version__) logging.exception('Borg %s: exception in RPC call:', __version__)
logging.error(sysinfo()) logging.error(sysinfo())
exc = "Remote Exception (see remote log for the traceback)" exc = "Remote Exception (see remote log for the traceback)"