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

Show last exception text and NIKOLA_DEBUG explanation (#2774 #2771) #2782

Merged
merged 2 commits into from May 21, 2017

Conversation

Kwpolska
Copy link
Member

This improves #2771 and #2774. It shows the text of only the last exception, and advertises NIKOLA_DEBUG=1.

(We can’t rely on logging from other places, because not all exceptions come from within Nikola itself)

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
"""Print an exception in a friendlier, shorter style."""
etype, evalue, _ = sys.exc_info()
LOGGER.error(''.join(traceback.format_exception(etype, evalue, None, limit=0, chain=False)).strip())
LOGGER.notice("To see more details, run Nikola in debug mode (set environment variable NIKOLA_DEBUG=1)")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe only print this if debug mode isn't already enabled?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, ignore that. This is only called in case NIKOLA_DEBUG is not 1.

@ralsina ralsina merged commit 2a7faa1 into master May 21, 2017
@Kwpolska Kwpolska deleted the better-errors-than-windows branch May 25, 2017 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants