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

Fix traceback of unhandled top-level exceptions #10

Merged
merged 1 commit into from
Apr 12, 2019

Conversation

kusha
Copy link
Contributor

@kusha kusha commented Apr 12, 2019

There is no need to raise the exception to log it. Exception log call can receive exc_info parameter.
Before (incorrect traceback):

Traceback (most recent call last):
  File "/home/mbirger/workspace/kafka-logging-handler/kafka_logger/handlers.py", line 194, in unhandled_exception
    raise exception
  File "examples/simple.py", line 63, in <module>
    main()
  File "examples/simple.py", line 59, in main
    raise Exception('No try/except block here')
Exception: No try/except block here

After:

Traceback (most recent call last):
  File "examples/simple.py", line 63, in <module>
    main()
  File "examples/simple.py", line 59, in main
    raise Exception('No try/except block here')
Exception: No try/except block here

@mjahudko
Copy link

LGTM +1

Copy link
Collaborator

@rmonegro rmonegro left a comment

Choose a reason for hiding this comment

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

LGTM

@rmonegro rmonegro merged commit 84be352 into redhat-aqe:master Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants