Is reports whether the "err" is an *Error.
(err error)
| 111 | |
| 112 | // Is reports whether the "err" is an *Error. |
| 113 | func (e *Error) Is(err error) bool { |
| 114 | if err == nil { |
| 115 | return false |
| 116 | } |
| 117 | |
| 118 | ok := errors.Is(e.Err, err) |
| 119 | if !ok { |
| 120 | te, ok := err.(*Error) |
| 121 | if !ok { |
| 122 | return false |
| 123 | } |
| 124 | |
| 125 | return errors.Is(e.Err, te.Err) |
| 126 | } |
| 127 | |
| 128 | return ok |
| 129 | } |
| 130 | |
| 131 | // As reports whether the "target" can be used as &Error{target.Type: ?}. |
| 132 | func (e *Error) As(target interface{}) bool { |
no outgoing calls