This repository was archived by the owner on Jan 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy patherrors.go
59 lines (48 loc) · 1.54 KB
/
errors.go
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package common
import (
"fmt"
"github.com/chromedp/cdproto/runtime"
)
// Error is a common package error.
type Error string
// Error satisfies the builtin error interface.
func (e Error) Error() string {
return string(e)
}
// Error types.
const (
ErrUnexpectedRemoteObjectWithID Error = "cannot extract value when remote object ID is given"
ErrChannelClosed Error = "channel closed"
ErrFrameDetached Error = "frame detached"
ErrJSHandleDisposed Error = "JS handle is disposed"
ErrJSHandleInvalid Error = "JS handle is invalid"
ErrTargetCrashed Error = "Target has crashed"
ErrTimedOut Error = "timed out"
ErrWrongExecutionContext Error = "JS handles can be evaluated only in the context they were created"
)
type BigIntParseError struct {
err error
}
// Error satisfies the builtin error interface.
func (e BigIntParseError) Error() string {
return fmt.Sprintf("parsing bigint: %v", e.err)
}
// Is satisfies the builtin error Is interface.
func (e BigIntParseError) Is(target error) bool {
switch target.(type) {
case BigIntParseError:
return true
}
return false
}
// Unwrap satisfies the builtin error Unwrap interface.
func (e BigIntParseError) Unwrap() error {
return e.err
}
type UnserializableValueError struct {
UnserializableValue runtime.UnserializableValue
}
// Error satisfies the builtin error interface.
func (e UnserializableValueError) Error() string {
return fmt.Sprintf("unsupported unserializable value: %s", e.UnserializableValue)
}