go-tarantool icon indicating copy to clipboard operation
go-tarantool copied to clipboard

Add Unwrap interface implementation for Errors types

Open wh75er opened this issue 1 year ago • 0 comments

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

wh75er avatar Dec 12 '23 14:12 wh75er