UNPKG

kura

Version:

The FileSystem API abstraction library.

75 lines 2.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NotImplementedError = exports.PathExistsError = exports.InvalidModificationError = exports.InvalidStateError = exports.NoModificationAllowedError = exports.NotReadableError = exports.NotFoundError = exports.AbstractFileError = void 0; class AbstractFileError { constructor(key, fullPath, e) { this.key = key; this.fullPath = fullPath; if (e instanceof Error) { this.e = e.name + ", " + e.message; this.stack = e.stack; } else { this.e = e; this.stack = new Error().stack; } } } exports.AbstractFileError = AbstractFileError; class NotFoundError extends AbstractFileError { constructor(key, fullPath, detail) { super(key, fullPath, detail); this.code = 1; this.name = "Not found error"; } } exports.NotFoundError = NotFoundError; class NotReadableError extends AbstractFileError { constructor(key, fullPath, detail) { super(key, fullPath, detail); this.code = 1; this.name = "Not readable error"; } } exports.NotReadableError = NotReadableError; class NoModificationAllowedError extends AbstractFileError { constructor(key, fullPath, detail) { super(key, fullPath, detail); this.code = 6; this.name = "No modification allowed error"; } } exports.NoModificationAllowedError = NoModificationAllowedError; class InvalidStateError extends AbstractFileError { constructor(key, fullPath, detail) { super(key, fullPath, detail); this.code = 7; this.name = "Invalid state error"; } } exports.InvalidStateError = InvalidStateError; class InvalidModificationError extends AbstractFileError { constructor(key, fullPath, detail) { super(key, fullPath, detail); this.code = 9; this.name = "Invalid modification error"; } } exports.InvalidModificationError = InvalidModificationError; class PathExistsError extends AbstractFileError { constructor(key, fullPath, detail) { super(key, fullPath, detail); this.code = 12; this.name = "Path exists error"; } } exports.PathExistsError = PathExistsError; class NotImplementedError extends AbstractFileError { constructor(key, fullPath, detail) { super(key, fullPath, detail); this.code = -1; this.name = "Not implemented"; } } exports.NotImplementedError = NotImplementedError; //# sourceMappingURL=FileError.js.map