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

Non-wrapped error #123

Closed
GabdaZM opened this issue Oct 7, 2020 · 3 comments · Fixed by #124
Closed

Non-wrapped error #123

GabdaZM opened this issue Oct 7, 2020 · 3 comments · Fixed by #124

Comments

@GabdaZM
Copy link

GabdaZM commented Oct 7, 2020

In protocol/internal/error.go, in func (e OpError) Error() string the error is composed with fmt.Sprintf instead of wrapping the error.
This way, when I have a cdp.Runtime: CallFunctionOn: context deadline exceeded error, the errors.Is(err, context.DeadlineExceeded) check returns with false.

Would it be possible to modify it to use errors.Wrap() instead?

@mafredri
Copy link
Owner

mafredri commented Oct 7, 2020

Hi, I did an early experiment on this in a branch that has not yet been merged (commit 3db9e5e). Unfortunately it fell into oblivion for 1.5 years 😬.

Would the changes done above work for you? I'll look into getting it merged.

@GabdaZM
Copy link
Author

GabdaZM commented Oct 8, 2020

Thanks for the fast response! Yes, I think so. The new Unwrap() function in protocol/internal/error.go looks promising. Though I don't really understand the other changes, but those might be unrelated.

@mafredri
Copy link
Owner

mafredri commented Oct 9, 2020

@GabdaZM this was released in v0.30.0.

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

Successfully merging a pull request may close this issue.

2 participants