(value: unknown)
| 38 | } |
| 39 | |
| 40 | export function assertIsError(value: unknown): asserts value is Error & { code?: string } { |
| 41 | const isError = |
| 42 | value instanceof Error || |
| 43 | // The following is needing to identify errors coming from RxJs. |
| 44 | (typeof value === 'object' && value && 'name' in value && 'message' in value); |
| 45 | assert(isError, 'catch clause variable is not an Error instance'); |
| 46 | } |
no outgoing calls
no test coverage detected