github
740 of 1053 new or added lines in 28 files covered. (70.28%)
9 existing lines in 5 files now uncovered.4058 of 5441 relevant lines covered (74.58%)
3081.59 hits per line
1 |
package playwright
|
|
2 |
|
|
3 |
// Error represents a Playwright error
|
|
4 |
type Error struct { |
|
5 |
Name string
|
|
6 |
Message string
|
|
7 |
Stack string
|
|
8 |
} |
|
9 |
|
|
10 |
func (e *Error) Error() string { |
265✔ |
11 |
return e.Message
|
265✔ |
12 |
} |
265✔ |
13 |
|
|
|
func (e *Error) Is(target error) bool { |
8✔ |
|
err, ok := target.(*Error) |
8✔ |
|
if !ok {
|
8✔ |
NEW
|
return false |
× |
NEW
|
} |
× |
|
if err.Name != e.Name {
|
8✔ |
NEW
|
return false |
× |
NEW
|
} |
× |
|
if e.Name != "Error" { |
16✔ |
|
return true // same name and not normal error |
8✔ |
|
} |
8✔ |
NEW
|
return e.Message == err.Message
|
× |
26 |
} |
|
27 |
|
|
28 |
// TimeoutError represents a Playwright TimeoutError
|
|
29 |
var TimeoutError = &Error{
|
|
30 |
Name: "TimeoutError",
|
|
31 |
} |
|
32 |
|
|
33 |
func parseError(err errorPayload) error { |
228✔ |
34 |
return &Error{
|
228✔ |
35 |
Name: err.Name, |
228✔ |
36 |
Message: err.Message, |
228✔ |
37 |
Stack: err.Stack, |
228✔ |
38 |
} |
228✔ |
39 |
} |
228✔ |