IsTyped reports whether err is or wraps any of the typed *errs.* errors in this package (i.e. implements the TypedError interface). Used by call sites that need to pass already-classified errors through unchanged instead of blanket-rewrapping them as a different category.
(err error)
| 92 | // sites that need to pass already-classified errors through unchanged |
| 93 | // instead of blanket-rewrapping them as a different category. |
| 94 | func IsTyped(err error) bool { |
| 95 | var t TypedError |
| 96 | return errors.As(err, &t) |
| 97 | } |