-
Notifications
You must be signed in to change notification settings - Fork 93
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
cli: provide full traceback with --debug #4181
Conversation
(will do the changelog once b1 is out) |
6f7bd12
to
b72ef4a
Compare
# catch "known" CylcErrors which should have sensible short | ||
# summations of the issue, full traceback not necessary | ||
print( | ||
EXC_EXIT.format( | ||
name=exc.__class__.__name__, | ||
exc=exc | ||
), | ||
file=sys.stderr | ||
) | ||
sys.exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Note to self, really) Ah, so this is called when commands other than cylc play
raise, or if an exception occurs in scheduler_cli
before it runs the scheduler - the scheduler has its own error logging logic
Question: Should I update #4180 so that if --debug
is used, the scheduler will print out the full traceback for CylcError
s too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if the scheduler dumped full traceback in --debug
mode (can be helpful sometimes).
We should always display full traceback unless the command is running interactively AND the error is an expected one (i.e. a subclass of
CylcError
,ParsecError
) BUT we are not in--debug
mode.In this one case formatting a nice friendly error message for the user is much nicer.
That was the intention but unfortunately it wasn't quite implemented right so here's a fix and a test to go with it.
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.