[GH-ISSUE #1051] A way to catch errors? #762

Closed
opened 2026-03-04 01:07:33 +03:00 by kerem · 1 comment
Owner

Originally created by @jcardonne on GitHub (Nov 5, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1051

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.

Originally created by @jcardonne on GitHub (Nov 5, 2024). Original GitHub issue: https://github.com/rivo/tview/issues/1051 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.
kerem closed this issue 2026-03-04 01:07:33 +03:00
Author
Owner

@rivo commented on GitHub (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.

<!-- gh-comment-id:2457779961 --> @rivo commented on GitHub (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()`](https://pkg.go.dev/github.com/rivo/tview#Application.Stop) before printing the stack trace.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#762
No description provided.