Skip to content
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

errors.Is compatibility #138

Closed
alexedwards opened this issue May 6, 2020 · 1 comment
Closed

errors.Is compatibility #138

alexedwards opened this issue May 6, 2020 · 1 comment
Labels

Comments

@alexedwards
Copy link

Do you know if there is any way to check for schema.MultiError using errors.Is()?

The following playground link demonstrates the problem I'm having:

https://play.golang.org/p/jwrz20goQqy

It's possible to check the error type using a type assertion, but that only remains possible if the error is never wrapped between being raised and the check.

The same thing seems to be true for schema.ConversionError and schema.UnknownKeyError.

@alexedwards
Copy link
Author

Sorry, I was having a complete brain fart when I asked this -- it works fine when checking with errors.As() which is what I should have been using. See https://play.golang.org/p/_e8UmbXD1J- for working example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant