alacritty-theme-switch
Version:
CLI utility for switching Alacritty color themes
85 lines (84 loc) • 2.44 kB
JavaScript
/**
* Error thrown when creating a backup fails.
*/
export class BackupError extends Error {
constructor(path, options) {
super(`Failed to create backup of ${path}.`, options);
Object.defineProperty(this, "_tag", {
enumerable: true,
configurable: true,
writable: true,
value: "BackupError"
});
Object.defineProperty(this, "path", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.path = path;
}
}
/**
* Error thrown when a theme is not found.
*/
export class ThemeNotFoundError extends Error {
constructor(filename, options) {
super(`Given selected theme ${filename} does not exist.`, options);
Object.defineProperty(this, "_tag", {
enumerable: true,
configurable: true,
writable: true,
value: "ThemeNotFoundError"
});
Object.defineProperty(this, "filename", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.filename = filename;
}
}
/**
* Error thrown when a theme is not a TOML file.
*/
export class ThemeNotTOMLError extends Error {
constructor(path, options) {
super(`Given selected theme ${path} is not a TOML file.`, options);
Object.defineProperty(this, "_tag", {
enumerable: true,
configurable: true,
writable: true,
value: "ThemeNotTOMLError"
});
Object.defineProperty(this, "path", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.path = path;
}
}
/**
* Error thrown when no themes are found in a directory.
*/
export class NoThemesFoundError extends Error {
constructor(path, options) {
super(`Given themes directory ${path} does not contain any TOML files.`, options);
Object.defineProperty(this, "_tag", {
enumerable: true,
configurable: true,
writable: true,
value: "NoThemesFoundError"
});
Object.defineProperty(this, "path", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.path = path;
}
}