Is reports whether the current ApiError wraps the target.
(target error)
| 53 | |
| 54 | // Is reports whether the current ApiError wraps the target. |
| 55 | func (e *ApiError) Is(target error) bool { |
| 56 | err, ok := e.rawData.(error) |
| 57 | if ok { |
| 58 | return errors.Is(err, target) |
| 59 | } |
| 60 | |
| 61 | apiErr, ok := target.(*ApiError) |
| 62 | |
| 63 | return ok && e == apiErr |
| 64 | } |
| 65 | |
| 66 | // NewNotFoundError creates and returns 404 ApiError. |
| 67 | func NewNotFoundError(message string, rawErrData any) *ApiError { |
no outgoing calls