ErrorType returns the type name of the given error. If the error is [WrappedError], it returns the type of the inner error.
(err error)
| 37 | // ErrorType returns the type name of the given error. |
| 38 | // If the error is [WrappedError], it returns the type of the inner error. |
| 39 | func ErrorType(err error) string { |
| 40 | if ew, ok := err.(*WrappedError); ok { |
| 41 | return ErrorType(ew.Unwrap()) |
| 42 | } |
| 43 | return reflect.TypeOf(err).String() |
| 44 | } |
no test coverage detected