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

Capture correct tracebacks when using inline_callbacks. #475

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 14, 2021

  1. Capture correct tracebacks when using inline_callbacks.

    When an inlineCallback completes synchronously, such as in tests, twisted will
    string-ify the traceback, which means that when the exception is then thrown
    into another inlineCallback function, the stack trace is lost[1]. Twisted works
    around this by inspect the stack and finding the Failure instance from the
    inner call, to get traceback there.
    
    However, this only works if `Failure.throwExceptionIntoGenerator` is used.
    This adjusts eliot_friendly_generator_function to use `Failure`, instead of an
    exc_info tuple, when used via `inline_callabcks`.
    
    
    [1] The string-ified traceback can't be passed to `.send`.
    tomprince committed Jul 14, 2021
    Configuration menu
    Copy the full SHA
    c69db09 View commit details
    Browse the repository at this point in the history