Skip to content

Commit

Permalink
Refactor errorFromDOMError to return err
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed May 16, 2024
1 parent b953412 commit 5711416
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/element_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -1650,11 +1650,11 @@ func errorFromDOMError(v any) error {
serr = e
case error:
if e == nil {
panic("DOM error is nil")
return errors.New("DOM error is nil")
}
err, serr = e, e.Error()
default:
panic(fmt.Errorf("unexpected DOM error type %T", v))
return fmt.Errorf("unexpected DOM error type %T", v)
}
var uerr *k6ext.UserFriendlyError
if errors.As(err, &uerr) {
Expand Down

0 comments on commit 5711416

Please sign in to comment.