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

opt: fix panic recovery for error handling #38570

Merged
merged 1 commit into from
Jul 9, 2019

Commits on Jul 9, 2019

  1. opt: fix panic recovery for error handling

    The major entry points in the optimizer catch all panics that throw an
    error and converts them to errors. Unfortunately, this also catches
    runtime errors (in which case we convert them to errors and lose the
    stack trace).
    
    This change adds a `ShouldCatch` helper which determines if we should
    return a thrown object as an error. If the object is a
    `runtime.Error`, it gets wrapped by an AssertionFailed error which
    will cause correct error handling (stack trace, sentry reporting, etc).
    
    As part of this change, we are also removing wrappers like
    `builderError`, which are no longer useful. We fix the opt tester to
    fail with the full error information (using `%+v`) for assertion
    errors.
    
    Release note: None
    RaduBerinde committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    5ab44a9 View commit details
    Browse the repository at this point in the history