Skip to content

Commit

Permalink
Update error logging
Browse files Browse the repository at this point in the history
In case of tarball extraction failures, log the exception and stack
trace. These exceptions could cause the host to become stuck. The stack
trace can help with debugging.
  • Loading branch information
osoriano committed Sep 15, 2023
1 parent 352e8d5 commit b4dd1b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deploy-agent/deployd/download/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ def download(self):
log.info("Successfully extracted {} to {}".format(local_full_fn, working_dir))
except tarfile.TarError as e:
status = Status.FAILED
log.error("Failed to extract files: {}".format(e))
log.exception("Failed to extract tar files")
except OSError as e:
status = Status.FAILED
log.error("Failed: {}".format(e))
log.exception("Failed to extract files. OSError:")
except Exception:
status = Status.FAILED
log.error(traceback.format_exc())
log.exception("Failed to extract files")
finally:
return status

Expand Down

0 comments on commit b4dd1b2

Please sign in to comment.