sync: capture generic exceptions

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-03-14 20:10:42 +02:00
parent 7355c15f61
commit 1d17961732
+5 -5
View File
@@ -3,7 +3,6 @@ import os
import dvc.cloud.base as cloud
from dvc.command.common.base import CmdBase
from dvc.exceptions import DvcException
class CmdDataBase(CmdBase):
@@ -20,11 +19,12 @@ class CmdDataBase(CmdBase):
ret = 1
return ret
class CmdDataPull(CmdDataBase):
def do_run(self, target=None):
try:
self.project.pull(target=target, jobs=self.args.jobs)
except DvcException as exc:
except Exception as exc:
self.project.logger.error('Failed to pull data from the cloud', exc)
return 1
return 0
@@ -34,7 +34,7 @@ class CmdDataPush(CmdDataBase):
def do_run(self, target=None):
try:
self.project.push(target=target, jobs=self.args.jobs)
except DvcException as exc:
except Exception as exc:
self.project.logger.error('Failed to push data to the cloud', exc)
return 1
return 0
@@ -44,7 +44,7 @@ class CmdDataFetch(CmdDataBase):
def do_run(self, target=None):
try:
self.project.fetch(target=target, jobs=self.args.jobs)
except DvcException as exc:
except Exception as exc:
self.project.logger.error('Failed to fetch data from the cloud', exc)
return 1
return 0
@@ -72,7 +72,7 @@ class CmdDataStatus(CmdDataBase):
try:
status = self.project.status(target=target, jobs=self.args.jobs)
self._show(status)
except DvcException as exc:
except Exception as exc:
self.project.logger.error('Failed to obtain data status', exc)
return 1
return 0