Skip to content

Commit

Permalink
Wrap errors with go 1.13 %w verb
Browse files Browse the repository at this point in the history
  • Loading branch information
sashayakovtseva committed Apr 29, 2021
1 parent 7a8f96d commit 254eeac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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

0 comments on commit 254eeac

Please sign in to comment.