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

Kwpolska commented May 21, 2017

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>
@Kwpolska Kwpolska requested a review from ralsina May 21, 2017
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)")

This comment has been minimized.

Copy link
@felixfontein

felixfontein May 21, 2017

Contributor

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

This comment has been minimized.

Copy link
@felixfontein

felixfontein May 21, 2017

Contributor

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

@ralsina ralsina merged commit 2a7faa1 into master May 21, 2017
5 checks passed
5 checks passed
codacy/pr Good work! A positive pull request.
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@Kwpolska Kwpolska deleted the better-errors-than-windows branch May 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.