MCPcopy Create free account
hub / github.com/angular/angular / isErrorLike

Function isErrorLike

packages/core/src/error_handler.ts:116–124  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

114}
115
116export function isErrorLike(error: unknown): error is Error {
117 return (
118 error instanceof Error ||
119 (typeof error === 'object' &&
120 error !== null &&
121 typeof (error as Error).name === 'string' &&
122 typeof (error as Error).message === 'string')
123 );
124}
125
126/**
127 * Error thrown when an error boundary catches an error that is not an `Error` instance.

Callers 2

encapsulateResourceErrorFunction · 0.90
encapsulateBoundaryErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected