Re:Error stack traces in Go with x/xerror
by throwaway894345 on Monday August 23, 2021 @07:44PM
(#28283487)
I’ve been writing Go for a decade and I’ve liked it from the beginning, but stack trace support is welcome.
[ Parent
| on HN ]
Yep - my biggest gripe is seeing errors with no context around them - either a stack trace or...well...the context.Context.
I've just started writing C++ for work, and I have to say, I miss stack traces so much. Even with Go errors the wrapping usually made it easy enough, but with how long it takes to get gdb to launch from core dumps (~1m30 on our binaries at work), I really do miss that extra context.
Re:Error stack traces in Go with x/xerror
by bombela on Tuesday August 24, 2021 @04:35AM
(#28286342)
100% Shameless plug. Stack capture and pretty printer for C++: https://github.com/bombela/backward-cpp
This looks super neat. Thanks!
Re:Error stack traces in Go with x/xerror
by gpderetta on Tuesday August 24, 2021 @10:11AM
(#28289078)
It is not particularly hard to log stack traces in C++, for example from an abort signal handler or attaching them to exceptions.
There is no standard solution though, so you have to rely on 3rd party libraries or use platform specific solutions.