5 ms·
Good points raised. In Go, I've struggled to attach stack traces to errors. I have a plan (a custom error type, and type checking for that type) but it's not "b
by nightowl_games 3y ago
Good points raised. In Go, I've struggled to attach stack traces to errors. I have a plan (a custom error type, and type checking for that type) but it's not "bulletproof". Seems similar. Seems like there's opportunity for some language evolution here.
- linux2647 3y agoIIRC, part of the language proposal to make errors wrappable in Go’s stdlib included a stack trace. And indeed github.com/pkg/errors includes that. But it never made it into the stdlib implementation
- masklinn 3y ago> Seems similar. It's not: because error sets are a built-in and completely bespoke feature, and they get handled via built-in constructs exclusively (try / catch), zig can actually attach / generate error traces: https://ziglang.org/documentation/0.3.0/#Error-Return-Traces https://ziglang.org/documentation/0.3.0/#Error-Return-Traces