pip-services3-commons-node
Version:
Portable abstractions and patterns for Pip.Services in Node.js
47 lines • 2.18 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
/** @module errors */
var ErrorCategory_1 = require("./ErrorCategory");
var ApplicationException_1 = require("./ApplicationException");
/**
* Errors caused by attempts to access missing objects.
*/
var NotFoundException = /** @class */ (function (_super) {
__extends(NotFoundException, _super);
/**
* Creates an error instance and assigns its values.
*
* @param correlation_id (optional) a unique transaction id to trace execution through call chain.
* @param code (optional) a unique error code. Default: "UNKNOWN"
* @param message (optional) a human-readable description of the error.
*
* @see [[ErrorCategory]]
*/
function NotFoundException(correlation_id, code, message) {
if (correlation_id === void 0) { correlation_id = null; }
if (code === void 0) { code = null; }
if (message === void 0) { message = null; }
var _this = _super.call(this, ErrorCategory_1.ErrorCategory.NotFound, correlation_id, code, message) || this;
// Set the prototype explicitly.
// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
_this.__proto__ = NotFoundException.prototype;
_this.status = 404;
return _this;
}
return NotFoundException;
}(ApplicationException_1.ApplicationException));
exports.NotFoundException = NotFoundException;
//# sourceMappingURL=NotFoundException.js.map
;