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

Decode context.Canceled, context.DeadlineExceeded etc as a reference to the stdlib instance #87

Open
knz opened this issue Jan 7, 2022 · 1 comment

Comments

@knz
Copy link
Contributor

knz commented Jan 7, 2022

Currently, instances of the stdlib errors trasnferred over the network are decoded into an object of the same type/value, but not the same instance. So reference comparisons with == with the stdlib instance fail.

This matters for e.g. context.Context.Err() which describes in its API doc that it returns the standrd errors unwrapped so it's legitimate for a caller to use ==.

We could address that by adding a special case in the leaf decoder, so that if a leaf is one of the known stdlib errors, we return the stdlib instance instead.

@knz
Copy link
Contributor Author

knz commented Jan 18, 2022

Some progress made here: #89

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