angular-cn/packages/zone.js/lib/common
JiaLiPassion 8456c5ec60 feat(zone.js): add a zone config to allow user disable wrapping uncaught promise rejection (#35873)
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
2020-03-16 09:00:10 -07:00
..
error-rewrite.ts fix(zone.js): don't rely on global node typings outside of node/ directory (#31783) 2019-07-30 12:59:40 -07:00
events.ts feat: add a temp solution to support passive event listeners. (#34503) 2020-02-24 17:30:04 -08:00
fetch.ts
promise.ts feat(zone.js): add a zone config to allow user disable wrapping uncaught promise rejection (#35873) 2020-03-16 09:00:10 -07:00
timers.ts refactor: ensure zone.js can be built with typescript strict flag (#30993) 2019-07-18 14:21:26 -07:00
to-string.ts refactor: ensure zone.js can be built with typescript strict flag (#30993) 2019-07-18 14:21:26 -07:00
utils.ts refactor: ensure zone.js can be built with typescript strict flag (#30993) 2019-07-18 14:21:26 -07:00