Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include original error from Stats #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions snakeviz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ def main(argv=None):

try:
Stats(filename)
except Exception:
parser.error(('The file %s is not a valid profile. ' % filename) +
except Exception as e:
parser.error(f'The file {filename} is not a valid profile. '
'Generate profiles using: \n\n'
'\tpython -m cProfile -o my_program.prof my_program.py\n\n'
'Note that snakeviz must be run under the same '
'version of Python as was used to create the profile.\n')
'version of Python as was used to create the profile.\n'
f'Original exception from Stats module:\n{type(e).__name__}: {e}\n')

filename = quote(filename, safe='')

Expand Down