Fixed failing samples
Updated uuid/webpack packages Added froze on objects publicly exposed Removed remaining while loops for actions/events processing
This commit is contained in:
@ -8,11 +8,13 @@ function AccessDeniedError(action, streamOrTransactionId) {
|
||||
if (typeof streamOrTransactionId === 'string') {
|
||||
this.message = util.format("%s access denied for stream '%s'.", action, streamOrTransactionId);
|
||||
this.stream = streamOrTransactionId;
|
||||
Object.freeze(this);
|
||||
return;
|
||||
}
|
||||
if (Long.isLong(streamOrTransactionId)) {
|
||||
this.message = util.format("%s access denied for transaction %s.", action, streamOrTransactionId);
|
||||
this.transactionId = streamOrTransactionId;
|
||||
Object.freeze(this);
|
||||
return;
|
||||
}
|
||||
throw new TypeError("second argument must be a stream name or transaction Id.");
|
||||
|
@ -7,11 +7,13 @@ function StreamDeletedError(streamOrTransactionId) {
|
||||
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.");
|
||||
|
@ -9,11 +9,13 @@ function WrongExpectedVersionError(action, streamOrTransactionId, expectedVersio
|
||||
this.message = util.format("%s failed due to WrongExpectedVersion. Stream: %s Expected version: %d.", action, streamOrTransactionId, expectedVersion);
|
||||
this.stream = streamOrTransactionId;
|
||||
this.expectedVersion = expectedVersion;
|
||||
Object.freeze(this);
|
||||
return;
|
||||
}
|
||||
if (Long.isLong(streamOrTransactionId)) {
|
||||
this.message = util.format("%s transaction failed due to WrongExpectedVersion. Transaction Id: %s.", action, streamOrTransactionId);
|
||||
this.transactionId = streamOrTransactionId;
|
||||
Object.freeze(this);
|
||||
return;
|
||||
}
|
||||
throw new TypeError("second argument must be a stream name or a transaction Id.");
|
||||
|
Reference in New Issue
Block a user