1
0
Fork 0
arangodb/js/apps/system/_system/sessions/APP/errors.js

34 lines
1.0 KiB
JavaScript

'use strict';
function SessionNotFound(sid) {
this.message = 'Session with session id ' + sid + ' not found.';
this.name = this.name;
Error.captureStackTrace(this, SessionNotFound);
}
SessionNotFound.prototype = new Error();
SessionNotFound.prototype.constructor = SessionNotFound;
Object.defineProperty(SessionNotFound.prototype, 'name', {
enumerable: true,
configurable: true,
get: function () {
return this.constructor.name;
}
});
function SessionExpired(sid) {
this.message = 'Session with session id ' + sid + ' has expired.';
this.name = this.name;
Error.captureStackTrace(this, SessionExpired);
}
SessionExpired.prototype = Object.create(SessionNotFound.prototype);
SessionExpired.prototype.constructor = SessionExpired;
SessionExpired.prototype.name = SessionExpired.name;
Object.defineProperty(SessionExpired.prototype, 'name', {
enumerable: true,
configurable: true,
get: function () {
return this.constructor.name;
}
});
exports.SessionNotFound = SessionNotFound;
exports.SessionExpired = SessionExpired;