FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve error reporting in the "try_run" function and correctly include original command output in the error message by Kami · Pull Request #153 · codecov/codecov-python · GitHub

This repository was archived by the owner on May 21, 2025. It is now read-only.
/ codecov-python Public archive
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 5 additions & 2 deletions codecov/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def check_output(cmd, **popen_args):
process = Popen(cmd, stdout=PIPE, **popen_args)
output, _ = process.communicate()
if process.returncode:
raise CalledProcessError(process.returncode, cmd)
raise CalledProcessError(process.returncode, cmd, output)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

else:
assert process.returncode == 0
return output.decode("utf-8")
Expand All @@ -223,7 +223,10 @@ def try_to_run(cmd, shell=False, cwd=None):
try:
return check_output(cmd, shell=shell, cwd=cwd)
except Exception as e:
write(" Error running `%s`: %s" % (cmd, e or str(e)))
write(
" Error running `%s`: returncode=%s, output=%s"
% (cmd, e.returncode, str(getattr(e, "output", str(e))))
)
return None


Expand Down

Back | FazBrowse Home | New Git URL