UNPKG

acelga-bus

Version:

An extensible typescript message bus with support for middlewares

12 lines (9 loc) 456 B
import {Constructable} from './interfaces'; export class EventAlreadySubscribed<T> extends Error { eventType: Constructable<T>; constructor(eventType: Constructable<T>) { super(); this.eventType = eventType; this.message = 'The Event you want to subscribe already has one subscription. Only one subscription is allowed in order to keep processing simple to reason about. If you want to do that for sure, please, create a new Bus instance.'; } }