HasCode returns whether the given error has the given error code. If the error doesn't implement codes, it doesn't have any code.
(err error, c uint32)
| 72 | // HasCode returns whether the given error has the given error code. |
| 73 | // If the error doesn't implement codes, it doesn't have any code. |
| 74 | func HasCode(err error, c uint32) bool { |
| 75 | return code(err) == c |
| 76 | } |
| 77 | |
| 78 | // IsCanceled returns whether the givenerror is context.Canceled or of type Canceled. |
| 79 | func IsCanceled(err error) bool { |
no test coverage detected