MCPcopy Index your code
hub / github.com/angular/angular / _callAndReportToErrorHandler

Function _callAndReportToErrorHandler

packages/core/src/platform/bootstrap.ts:217–238  ·  view source on GitHub ↗
(
  errorHandler: (e: unknown) => void,
  ngZone: NgZone,
  callback: () => any,
)

Source from the content-addressed store, hash-verified

215}
216
217function _callAndReportToErrorHandler(
218 errorHandler: (e: unknown) => void,
219 ngZone: NgZone,
220 callback: () => any,
221): any {
222 try {
223 const result = callback();
224 if (isPromise(result)) {
225 return result.catch((e: any) => {
226 ngZone.runOutsideAngular(() => errorHandler(e));
227 // rethrow as the exception handler might not do it
228 throw e;
229 });
230 }
231
232 return result;
233 } catch (e) {
234 ngZone.runOutsideAngular(() => errorHandler(e));
235 // rethrow as the exception handler might not do it
236 throw e;
237 }
238}

Callers 1

bootstrapFunction · 0.85

Calls 5

isPromiseFunction · 0.90
callbackFunction · 0.50
errorHandlerFunction · 0.50
catchMethod · 0.45
runOutsideAngularMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…