UnsubscriptionError.js 614 B

1234567891011121314151617
  1. /**
  2. * An error thrown when one or more errors have occurred during the
  3. * `unsubscribe` of a {@link Subscription}.
  4. */
  5. export class UnsubscriptionError extends Error {
  6. constructor(errors) {
  7. super();
  8. this.errors = errors;
  9. const err = Error.call(this, errors ?
  10. `${errors.length} errors occurred during unsubscription:
  11. ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : '');
  12. this.name = err.name = 'UnsubscriptionError';
  13. this.stack = err.stack;
  14. this.message = err.message;
  15. }
  16. }
  17. //# sourceMappingURL=UnsubscriptionError.js.map