-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy patherror.go
More file actions
58 lines (45 loc) · 1.27 KB
/
error.go
File metadata and controls
58 lines (45 loc) · 1.27 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package urlquery
import (
"reflect"
"strconv"
)
// An ErrUnhandledType is a customized error
type ErrUnhandledType struct {
typ reflect.Type
}
func (e ErrUnhandledType) Error() string {
return "failed to unhandled type(" + e.typ.String() + ")"
}
// An ErrInvalidUnmarshalError is a customized error
type ErrInvalidUnmarshalError struct{}
func (e ErrInvalidUnmarshalError) Error() string {
return "failed to unmarshal(non-pointer)"
}
// An ErrUnsupportedBitSize is a customized error
type ErrUnsupportedBitSize struct {
bitSize int
}
func (e ErrUnsupportedBitSize) Error() string {
return "failed to handle unsupported bitSize(" + strconv.Itoa(e.bitSize) + ")"
}
// An ErrTranslated is a customized error type
type ErrTranslated struct {
err error
}
func (e ErrTranslated) Error() string {
return "failed to translate:" + e.err.Error()
}
// An ErrInvalidMapKeyType is a customized error
type ErrInvalidMapKeyType struct {
typ reflect.Type
}
func (e ErrInvalidMapKeyType) Error() string {
return "failed to handle map key type(" + e.typ.String() + ")"
}
// An ErrInvalidMapValueType is a customized error
type ErrInvalidMapValueType struct {
typ reflect.Type
}
func (e ErrInvalidMapValueType) Error() string {
return "failed to handle map value type(" + e.typ.String() + ")"
}