Skip to content

Expose traceTree or some variant #71

@bufdev

Description

@bufdev

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 traceTree directly. Likely not great, you probably don't want users mucking with this.
  • Have some public partial type that maps to traceTree under the hood.
  • Don't expose traceTree fully, but expose FormatTrace/FormatTraceString or 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions