UNPKG

node-eventstore-client

Version:

A port of the EventStore .Net ClientAPI to Node.js

23 lines (21 loc) 812 B
var util = require('util'); var Long = require('long'); function StreamDeletedError(streamOrTransactionId) { Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; if (typeof streamOrTransactionId === 'string') { this.message = util.format("Event stream '%s' is deleted.", streamOrTransactionId); this.stream = streamOrTransactionId; Object.freeze(this); return; } if (Long.isLong(streamOrTransactionId)) { this.message = util.format("Stream is deleted for transaction %s.", streamOrTransactionId); this.transactionId = streamOrTransactionId; Object.freeze(this); return; } throw new TypeError("second argument must be a stream name or transaction Id."); } util.inherits(StreamDeletedError, Error); module.exports = StreamDeletedError;