Re: [go-nuts] Re: A global panic handler for crash reporting

2024-01-03 Thread Johan Liebert
A global panic handler for crash reporting is a critical component in software development. It serves as a robust mechanism to capture, analyze, and respond to unexpected errors or crashes in applications. This handler acts as a safety net, allowing developers to receive real-time notificati

Re: [go-nuts] Re: A global panic handler for crash reporting

2023-12-26 Thread Gergely Brautigam
Yah, that's true, I completely forgot about that. :/ I guess you could do what some others have done which is implement a Call function or a framework that runs all function calls in a middleware-esk style. And middleware has a recovery. So every call will have a recovery. On Tuesday 26 Decembe

Re: [go-nuts] Re: A global panic handler for crash reporting

2023-12-26 Thread Jan Mercl
On Tue, Dec 26, 2023 at 9:12 AM Gergely Brautigam wrote: > If you have a top level recover in you main, it doesn't matter where the > panic happens, you'll capture it. Even in third party library. Iff the panic occurs in the same goroutine where the defer is. Every go statement starts a new gor

[go-nuts] Re: A global panic handler for crash reporting

2023-12-26 Thread Gergely Brautigam
If you have a top level recover in you main, it doesn't matter where the panic happens, you'll capture it. Even in third party library. package main import ( "fmt" "github.com/Skarlso/panic" ) func main() { defer func() { if r := recover(); r != nil { fmt.Println("Recovered in f", r) } }() fmt

[go-nuts] Re: A global panic handler for crash reporting

2023-12-25 Thread Nikolay Bryskin
Hey, Alan. I'm relatively new to Go, and faced a similar issue - I writing tests for a legacy codebase and want to fail the test if the tested code panics somewhere inside. Almost ten years passed - did you find or create a solution? On Tuesday, June 17, 2014 at 6:01:49 AM UTC+3 Alan Shreve wrot