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

A way to catch errors? #1051

Open
jcardonne opened this issue Nov 5, 2024 · 1 comment
Open

A way to catch errors? #1051

jcardonne opened this issue Nov 5, 2024 · 1 comment

Comments

@jcardonne
Copy link

I'm working on a large and complex project, I'm looking for a way to close the app before a panic/crash in order to print the stack traces.

For the moment, the errors can't be displayed properly when there is a crash due to tview display.

@rivo
Copy link
Owner

rivo commented Nov 5, 2024

If your application panics in the main goroutine, it will reset the console before printing the stack trace. But if it panics in some random goroutine, this cannot be detected and the terminal will not be ready to print a proper stack trace. You'll have to catch those yourself and either promote them to the main goroutine or call Application.Stop() before printing the stack trace.

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