source: trip-planner-front/node_modules/rxjs/src/internal/util/UnsubscriptionError.ts@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 875 bytes
Line 
1export interface UnsubscriptionError extends Error {
2 readonly errors: any[];
3}
4
5export interface UnsubscriptionErrorCtor {
6 new(errors: any[]): UnsubscriptionError;
7}
8
9const UnsubscriptionErrorImpl = (() => {
10 function UnsubscriptionErrorImpl(this: any, errors: any[]) {
11 Error.call(this);
12 this.message = errors ?
13 `${errors.length} errors occurred during unsubscription:
14${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : '';
15 this.name = 'UnsubscriptionError';
16 this.errors = errors;
17 return this;
18 }
19
20 UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);
21
22 return UnsubscriptionErrorImpl;
23})();
24
25/**
26 * An error thrown when one or more errors have occurred during the
27 * `unsubscribe` of a {@link Subscription}.
28 */
29export const UnsubscriptionError: UnsubscriptionErrorCtor = UnsubscriptionErrorImpl as any;
Note: See TracBrowser for help on using the repository browser.