Skip to content
Snippets Groups Projects
Commit 85877533 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[data] Use new exceptions module

parent b7d376c5
No related branches found
No related tags found
2 merge requests!281.6.x,!27Soft loop
...@@ -50,31 +50,10 @@ from collections import namedtuple ...@@ -50,31 +50,10 @@ from collections import namedtuple
from .hash import hashFileContents from .hash import hashFileContents
from .dataformat import DataFormat from .dataformat import DataFormat
from .algorithm import Algorithm from .algorithm import Algorithm
from .exceptions import RemoteException
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# ----------------------------------------------------------
class RemoteException(Exception):
"""Exception happening on a remote location"""
def __init__(self, kind, message):
super(RemoteException, self).__init__()
if kind == 'sys':
self.system_error = message
self.user_error = ''
else:
self.system_error = ''
self.user_error = message
def __str__(self):
if self.system_error:
return '(sys) {}'.format(self.system_error)
else:
return '(usr) {}'.format(self.user_error)
# ---------------------------------------------------------- # ----------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment