-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
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?
Metadata
Metadata
Assignees
Labels
No labels