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

Wrap errors with go 1.13 %w verb #743

Merged
merged 3 commits into from Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion browser.go
Expand Up @@ -112,7 +112,7 @@ func NewBrowser(ctx context.Context, urlstr string, opts ...BrowserOption) (*Bro
urlstr = forceIP(urlstr)
b.conn, err = DialContext(dialCtx, urlstr, WithConnDebugf(b.dbgf))
if err != nil {
return nil, fmt.Errorf("could not dial %q: %v", urlstr, err)
return nil, fmt.Errorf("could not dial %q: %w", urlstr, err)
}

go b.run(ctx)
Expand Down
2 changes: 1 addition & 1 deletion chromedp.go
Expand Up @@ -386,7 +386,7 @@ func (c *Context) attachTarget(ctx context.Context, targetID target.ID) error {

for _, action := range actions {
if err := action.Do(cdp.WithExecutor(ctx, c.Target)); err != nil {
return fmt.Errorf("unable to execute %T: %v", action, err)
return fmt.Errorf("unable to execute %T: %w", action, err)
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion query.go
Expand Up @@ -934,7 +934,7 @@ func JavascriptAttribute(sel interface{}, name string, res interface{}, opts ...
if err := evalInCtx(ctx, execCtx,
snippet(attributeJS, cashX(true), sel, nodes[0], name), res,
); err != nil {
return fmt.Errorf("could not retrieve attribute %q: %v", name, err)
return fmt.Errorf("could not retrieve attribute %q: %w", name, err)
}
return nil
}, opts...)
Expand Down