UNPKG

glitchkit

Version:

A lightweight toolkit to create and manage expressive, structured, and reusable error types. Perfect for APIs, services, and glitchy adventures

32 lines (31 loc) 1.06 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const GlitchKitBaseError_1 = __importDefault(require("./GlitchKitBaseError")); class GlitchKitBaseFileSystemError extends GlitchKitBaseError_1.default { constructor(message, errorCode) { super(message, errorCode); Object.setPrototypeOf(this, GlitchKitBaseFileSystemError.prototype); Error.captureStackTrace(this, this.constructor); } get path() { return this._path; } set path(value) { this._path = value; } withPath(path) { this._path = path; return this; } static isInstance(error) { return error instanceof GlitchKitBaseFileSystemError; } toJSON() { const jsonError = Object.assign(Object.assign({}, super.toJSON()), { path: this._path }); return jsonError; } } exports.default = GlitchKitBaseFileSystemError;