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

How to catch panics #1

Open
penguinpowernz opened this issue Mar 25, 2019 · 1 comment
Open

How to catch panics #1

penguinpowernz opened this issue Mar 25, 2019 · 1 comment

Comments

@penguinpowernz
Copy link

I noticed that using this library, panics were masked (in particular and nil pointer error). Any idea how to ensure panics get through? Or at least hear about them... the ctx.Err() in the context given to the callback on a Register call is nil.

@zachdeibert
Copy link

Try replacing:

defer goodbye.Exit(ctx, -1)

with:

defer func() {
    if e := recover(); e != nil {
        panic(e)
    } else {
        goodbye.Exit(ctx, -1)
    }
}()

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

No branches or pull requests

2 participants