1 export interface UnsubscriptionError extends Error {
2 readonly errors: any[];
5 export interface UnsubscriptionErrorCtor {
6 new(errors: any[]): UnsubscriptionError;
9 const UnsubscriptionErrorImpl = (() => {
10 function UnsubscriptionErrorImpl(this: any, errors: any[]) {
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';
20 UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);
22 return UnsubscriptionErrorImpl;
26 * An error thrown when one or more errors have occurred during the
27 * `unsubscribe` of a {@link Subscription}.
29 export const UnsubscriptionError: UnsubscriptionErrorCtor = UnsubscriptionErrorImpl as any;