UNPKG

pip-services3-commons-node

Version:
47 lines 2.14 kB
"use strict"; 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 in read/write local disk operations. */ var FileException = /** @class */ (function (_super) { __extends(FileException, _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 FileException(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.FileError, 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__ = FileException.prototype; _this.status = 500; return _this; } return FileException; }(ApplicationException_1.ApplicationException)); exports.FileException = FileException; //# sourceMappingURL=FileException.js.map