forked from go-rod/rod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.go
More file actions
44 lines (38 loc) · 1.03 KB
/
Copy patherror.go
File metadata and controls
44 lines (38 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package rod
import (
errors "github.com/pkg/errors"
)
var (
// ErrValue error
ErrValue = errors.New("error value")
// ErrExpectElement error
ErrExpectElement = errors.New("expect js to return an element")
// ErrExpectElements error
ErrExpectElements = errors.New("expect js to return an array of elements")
// ErrElementNotFound error
ErrElementNotFound = errors.New("cannot find element")
// ErrSrcNotFound error
ErrSrcNotFound = errors.New("element doesn't have src attribute")
// ErrEval error
ErrEval = errors.New("eval error")
// ErrNavigation error
ErrNavigation = errors.New("navigation failed")
// ErrNotClickable error
ErrNotClickable = errors.New("element is not clickable")
)
// Error ...
type Error struct {
Code error
Details interface{}
}
func newErr(code error, details interface{}, msg string) error {
return errors.WithStack(errors.WithMessage(&Error{code, details}, msg))
}
// Error ...
func (e *Error) Error() string {
return e.Code.Error()
}
// Unwrap ...
func (e *Error) Unwrap() error {
return e.Code
}