-
Notifications
You must be signed in to change notification settings - Fork 11
Description
This was motivated by wanting to get a printout of just the stack trace, without the underlying error message. That use was was a situation where I had error interceptor logic in place, but didn't control the underlying location where the error was printed, as that was controlled by a different library (github.com/spf13/cobra). I just wanted to get a stack trace to print out to a debug logger, but realized I couldn't just yet.
This could take different forms:
- Just expose
traceTreedirectly. Likely not great, you probably don't want users mucking with this. - Have some public partial type that maps to
traceTreeunder the hood. - Don't expose
traceTreefully, but exposeFormatTrace/FormatTraceStringor the like that just drops the error itself (would solve my original issue, but isn't as universal).
Potentially the most idiomatic way to do this would be to expose some custom error type where I can use errors.Is/As, which would solve the problem more generally, but I assume this was ruled out.
I may be missing something here, just starting to muck around with the library - apologies if this is polluting the issue space!