Re: [go-nuts] uber handler to collect stacktrace when program crashing

2022-05-30 Thread Harri L
If you write a wrapper, please look at the err2-package . It's an error-handling package, but we needed to build a panic-safe system with automatic stack tracing. Traces are context optimized as well. Here's a playground demo

Re: [go-nuts] uber handler to collect stacktrace when program crashing

2022-05-30 Thread Aggarwal Sre
Yes, I was asking about a generic handler. I am thinking of writing a wrapper function which takes a function and spuns up a goroutine with the above mentioned defer function by default. On Sat, May 28, 2022 at 1:27 AM 'Sean Liao' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I believ

Re: [go-nuts] uber handler to collect stacktrace when program crashing

2022-05-28 Thread 'Sean Liao' via golang-nuts
I believe this is asking for a single handler that will apply to all goroutines, to which the answer is no such feature exists - sean On Sat, May 28, 2022, 03:09 Ian Lance Taylor wrote: > On Fri, May 27, 2022 at 10:42 AM Aggarwal Sre > wrote: > > > > Is there a recommended pattern besides addi

Re: [go-nuts] uber handler to collect stacktrace when program crashing

2022-05-27 Thread Ian Lance Taylor
On Fri, May 27, 2022 at 10:42 AM Aggarwal Sre wrote: > > Is there a recommended pattern besides adding a defer call ( with recover > call, to collect debug stack trace) to each goroutine, for collecting a stack > trace when a golang is crashing due to any sort of panic. > > In other words, is th

[go-nuts] uber handler to collect stacktrace when program crashing

2022-05-27 Thread Aggarwal Sre
Hi , Is there a recommended pattern besides adding a defer call ( with recover call, to collect debug stack trace) to each goroutine, for collecting a stack trace when a golang is crashing due to any sort of panic. In other words, is there a way to register an uber handler ( probably using OS sig