Add exception guard

This commit is contained in:
allegroai 2019-07-08 23:27:53 +03:00
parent 02ba0e28d5
commit 8a1e31c4f0
2 changed files with 32 additions and 24 deletions

View File

@ -134,7 +134,11 @@ class IdObjectBase(InterfaceBase):
def reload(self):
if not self.id:
raise ValueError('Failed reloading %s: missing id' % type(self).__name__)
# noinspection PyBroadException
try:
self._data = self._reload()
except Exception:
pass
@classmethod
def normalize_id(cls, id):

View File

@ -28,6 +28,8 @@ class TaskStopSignal(object):
self._task_reset_state_counter = 0
def test(self):
# noinspection PyBroadException
try:
status = self.task.status
message = self.task.data.status_message
@ -54,3 +56,5 @@ class TaskStopSignal(object):
)
else:
self._task_reset_state_counter = 0
except Exception:
return None