Skip to content

Add Unwrap interface implementation for Errors types #70

@wh75er

Description

@wh75er

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions