Innovenergy_trunk/frontend/node_modules/testcafe-safe-storage/lib/errors.js

68 lines
3.7 KiB
JavaScript
Raw Normal View History

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MultipleSavedDataDetected = exports.SavedDataNotDetected = exports.LoadedDataInvalid = exports.CODES = void 0;
const TEXTS = __importStar(require("./texts.js"));
var CODES;
(function (CODES) {
CODES[CODES["E001"] = 1] = "E001";
CODES[CODES["E002"] = 2] = "E002";
CODES[CODES["E003"] = 3] = "E003";
})(CODES = exports.CODES || (exports.CODES = {}));
class BaseError extends Error {
constructor(...args) {
super();
this.name = new.target.name;
this.args = args;
}
get message() {
return this.template.format(...this.args);
}
}
class LoadedDataInvalid extends BaseError {
constructor() {
super(...arguments);
this.code = CODES.E001;
this.template = TEXTS.LOADED_DATA_INVALID;
}
}
exports.LoadedDataInvalid = LoadedDataInvalid;
class SavedDataNotDetected extends BaseError {
constructor() {
super(...arguments);
this.code = CODES.E002;
this.template = TEXTS.SAVED_DATA_NOT_DETECTED;
}
}
exports.SavedDataNotDetected = SavedDataNotDetected;
class MultipleSavedDataDetected extends BaseError {
constructor() {
super(...arguments);
this.code = CODES.E003;
this.template = TEXTS.MULTIPLE_SAVED_DATA_DETECTED;
}
}
exports.MultipleSavedDataDetected = MultipleSavedDataDetected;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2Vycm9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLGtEQUFvQztBQUlwQyxJQUFZLEtBSVg7QUFKRCxXQUFZLEtBQUs7SUFDYixpQ0FBUSxDQUFBO0lBQ1IsaUNBQUksQ0FBQTtJQUNKLGlDQUFJLENBQUE7QUFDUixDQUFDLEVBSlcsS0FBSyxHQUFMLGFBQUssS0FBTCxhQUFLLFFBSWhCO0FBSUQsTUFBZSxTQUE0QyxTQUFRLEtBQUs7SUFLcEUsWUFBb0IsR0FBRyxJQUFPO1FBQzFCLEtBQUssRUFBRSxDQUFDO1FBRVIsSUFBSSxDQUFDLElBQUksR0FBRyxHQUFHLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQztRQUM1QixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztJQUNyQixDQUFDO0lBRUQsSUFBVyxPQUFPO1FBQ2QsT0FBTyxJQUFJLENBQUMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUM5QyxDQUFDO0NBQ0o7QUFFRCxNQUFhLGlCQUFpQyxTQUFRLFNBQVk7SUFBbEU7O1FBQ0ksU0FBSSxHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUM7UUFDbEIsYUFBUSxHQUFHLEtBQUssQ0FBQyxtQkFBbUIsQ0FBQztJQUN6QyxDQUFDO0NBQUE7QUFIRCw4Q0FHQztBQUdELE1BQWEsb0JBQW9DLFNBQVEsU0FBWTtJQUFyRTs7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