mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
logger: use exception instead of error
The problem was happening because `logger.error` doesn't include any `exc_info`, and the `parse_exc` logic was previously to rely on the log record's `exc_info` instead of the global stack trace. There's still use cases when you want to just `log` an error without printing the stack trace, those are left untouched. You can search for them with: `grep -R 'logger.error' dvc/` --- Fix #1869
This commit is contained in:
+1
-1
@@ -90,7 +90,7 @@ class RemoteHTTP(RemoteBase):
|
||||
|
||||
except Exception:
|
||||
msg = "failed to download '{}'".format(from_info["path"])
|
||||
logger.error(msg)
|
||||
logger.exception(msg)
|
||||
continue
|
||||
|
||||
if not no_progress_bar:
|
||||
|
||||
+3
-3
@@ -272,7 +272,7 @@ class RemoteLOCAL(RemoteBase):
|
||||
d = json.load(fd)
|
||||
except Exception:
|
||||
msg = "Failed to load dir cache '{}'"
|
||||
logger.error(msg.format(os.path.relpath(path)))
|
||||
logger.exception(msg.format(os.path.relpath(path)))
|
||||
return []
|
||||
|
||||
if not isinstance(d, list):
|
||||
@@ -511,7 +511,7 @@ class RemoteLOCAL(RemoteBase):
|
||||
copyfile(from_info["path"], tmp_file, name=name)
|
||||
os.rename(tmp_file, to_info["path"])
|
||||
except Exception:
|
||||
logger.error(
|
||||
logger.exception(
|
||||
"failed to upload '{}' to '{}'".format(
|
||||
from_info["path"], to_info["path"]
|
||||
)
|
||||
@@ -555,7 +555,7 @@ class RemoteLOCAL(RemoteBase):
|
||||
|
||||
move(tmp_file, to_info["path"])
|
||||
except Exception:
|
||||
logger.error(
|
||||
logger.exception(
|
||||
"failed to download '{}' to '{}'".format(
|
||||
from_info["path"], to_info["path"]
|
||||
)
|
||||
|
||||
+2
-2
@@ -188,7 +188,7 @@ class RemoteS3(RemoteBase):
|
||||
)
|
||||
except Exception:
|
||||
msg = "failed to upload '{}'".format(from_info["path"])
|
||||
logger.error(msg)
|
||||
logger.exception(msg)
|
||||
continue
|
||||
|
||||
progress.finish_target(name)
|
||||
@@ -246,7 +246,7 @@ class RemoteS3(RemoteBase):
|
||||
msg = "failed to download '{}/{}'".format(
|
||||
from_info["bucket"], from_info["path"]
|
||||
)
|
||||
logger.error(msg)
|
||||
logger.exception(msg)
|
||||
continue
|
||||
|
||||
move(tmp_file, to_info["path"])
|
||||
|
||||
@@ -160,7 +160,7 @@ class RemoteSSH(RemoteBase):
|
||||
from_info["path"], to_info["path"], progress_title=name
|
||||
)
|
||||
except Exception:
|
||||
logger.error(
|
||||
logger.exception(
|
||||
"failed to download '{host}/{path}' to '{dest}'".format(
|
||||
host=from_info["host"],
|
||||
path=from_info["path"],
|
||||
|
||||
Reference in New Issue
Block a user