-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make fault less opinionated on displaying "stack" trace and error messages together #11
Comments
Some libraries (like uber-go/fx) are opionionated about how they print errors, fx always uses Others may just use Definitely a lot to be cleaned up here before a v1! Thanks for raising this. Alternatively, I could just ditch |
Ah damn! I realise that I had a major misunderstanding of the package because I was just messing about with it in a play.golang.org session and was using I think the reason why I thought it would look like a mix of both types is because the README file doesn't actually differentiate between My only recommendations would be to:
|
Ah good thanks for clarifying that! This is definitely a problem in communicating the behaviour in the documentation. I'll definitely clarify the behaviour around this and also get a better .Format() implementation sorted too that respects the various modifier runes of %v. |
Re: Format/%+v behaviour: #17 |
Great! Thanks! |
Re-opening this because I realised So, I'll probably just change type Chain []Step |
Resolved in v0.5.0 |
It is great that the final
err.Error()
returns the "stack" lines and the error messages intermingled. It is quite opinionated though. Users might want them separately, so adding some helper functions to Chain could be good, likechain.Stack()
to get the "stack" trace (separate from the errors) andchain.Error()
to get just the error messages without the "stack" trace.It might actually make more sense to just make
err.Error()
just return the error messages as per normal, like it would with normal golang error wrapping. Thenchain.String()
returns the combined format of "stack" lines plus error messages and then add a helper function likechain.Stack()
to return just the "stack" lines.The text was updated successfully, but these errors were encountered: