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
Proposal: Support for error types #238
Comments
@caarlos0 should I take a look at that improvement? |
ah, this is a good one indeed yes @akutuev feel free to take a hit at it thanks everyone! |
Hello all, I did some brief investigations and let me put my input here: Due to our new improvement #208 (and its PR #233) we aggregate multiple errors (even with multiple types) to be able to provide a single aggregated message for a user. Therefore to identify the error type we have to iterate over the list of errors. If it makes sense, The user should:
In general, this approach won't lead to breaking changes but might bring some complexity @caarlos0 @jurajkulich Happy to get your opinion |
@akutuev that sounds good yes! I wonder if we should wait to see how the aggregate errors are looking like in go 1.20... haven't looked much into it yet, but maybe it makes this easier... |
merged #240 |
Hello,
At the moment, it's not possible to differentiate errors via error types. This could help determine the error directly instead of using, e.g.
strings.Contains
.For example:
The text was updated successfully, but these errors were encountered: