When debugging in vscode (or dlv) errors wrapped by errtrace are not shown in a nice way.
err: error(*braces.dev/errtrace.errTrace) *{err: error(*braces.dev/errtrace.errTrace) *{err: error(*braces.dev/errtrace.errTrace) ..., pc: 7387741}, pc: 7346695}
data: *braces.dev/errtrace.errTrace {err: error(*braces.dev/errtrace.errTrace) *{err: error(*braces.dev/errtrace.errTrace) ..., pc: 7387741}, pc: 7346695}
... and so on
It is possible use call errtrace.FormatString(err) in the vscode Watch window, but if the method is not used elsewhere in you code, you will get a could not find symbol value for errtrace from the Watch window instead.
This is caused by go's dead code elimination.
Workaround: put _ = errtrace.FormatString(errors.ErrUnsupported) somewhere in your code.
What about adding this as
func init() {
_ = errtrace.FormatString(errors.ErrUnsupported)
}
to errtrace itself?
When debugging in vscode (or dlv) errors wrapped by errtrace are not shown in a nice way.
It is possible use
call errtrace.FormatString(err)in the vscode Watch window, but if the method is not used elsewhere in you code, you will get acould not find symbol value for errtracefrom the Watch window instead.This is caused by go's dead code elimination.
Workaround: put
_ = errtrace.FormatString(errors.ErrUnsupported)somewhere in your code.What about adding this as
to errtrace itself?