Closed ghostsquad closed 11 months ago
Yes! This is confusing. We added errors.Errorf
so that you didn't have to import the standard library "errors" and get a name conflict – that was probably a mistake; because this library does not handle %w
specially.
The original motivation for me was to have errors with stacks. I am not a fan of the "keep adding context to the error message", because it's a lot more work, and less effective than just seeing the stack trace. If you want this library to get good results you need to use errors.Wrap()
and not errors.Errorf
; but that does mean that there is no way to add more words to the error message.
Oh. Ya, definitely want to add more context and get the stack trace.
https://go.dev/play/p/ThypuXRoewr
This only seems to print the last part of the stack trace. Am I doing something wrong? If so, maybe someone can show me what I'm doing wrong, and I can submit a PR to update the documentation. Thanks for your time!