mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Close #27840. By default, `zone.js` wrap uncaught promise error and wrap it to a new Error object with some additional information includes the value of the error and the stack trace. Consider the following example: ``` Zone.current .fork({ name: 'promise-error', onHandleError: (delegate: ZoneDelegate, current: Zone, target: Zone, error: any): boolean => { console.log('caught an error', error); delegate.handleError(target, error); return false; } }).run(() => { const originalError = new Error('testError'); Promise.reject(originalError); }); ``` The `promise-error` zone catches a wrapped `Error` object whose `rejection` property equals to the original error, and the message will be `Uncaught (in promise): testError....`, You can disable this wrapping behavior by defining a global configuraiton `__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION = true;` before importing `zone.js`. PR Close #35873 |
||
|---|---|---|
| .. | ||
| error-rewrite.ts | ||
| events.ts | ||
| fetch.ts | ||
| promise.ts | ||
| timers.ts | ||
| to-string.ts | ||
| utils.ts | ||