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

Add Unwrap interface implementation for Errors types #70

Open
wh75er opened this issue Dec 12, 2023 · 0 comments
Open

Add Unwrap interface implementation for Errors types #70

wh75er opened this issue Dec 12, 2023 · 0 comments

Comments

@wh75er
Copy link

wh75er commented Dec 12, 2023

Current error handling scheme is inconvenient and requires additional wrapping on go-tarantool package's client

For example - it is not possible to call errors.Is(err, context.Canceled) because of the current implementation.

My suggestion is to add Unwrap() error method for each error struct in https://github.com/viciious/go-tarantool/blob/master/error.go#L29 so it would be possible to compare go-tarantool errors with golang built-in errors by using errors.As or errors.Is functions

More information about Unwrap interface could be found here:
https://github.com/golang/go/blob/master/src/errors/errors.go#L12

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

No branches or pull requests

1 participant