refact: ink based terminal view (#17)

This commit is contained in:
Morten Olsen
2025-05-19 16:22:59 +02:00
committed by GitHub
parent 4514972880
commit 11f76a7378
17 changed files with 772 additions and 116 deletions

44
src/utils/errors.ts Normal file
View File

@@ -0,0 +1,44 @@
class BaseError extends Error {
constructor(message: string) {
super(message);
this.name = this.constructor.name;
}
}
class FileNotFoundError extends BaseError {
constructor(filePath: string) {
super(`File not found: ${filePath}`);
}
}
class InvalidFileError extends BaseError {
constructor(filePath: string) {
super(`Invalid file: ${filePath}`);
}
}
class InvalidFormatError extends BaseError {
constructor(format: string) {
super(`Invalid format: ${format}`);
}
}
class ScriptError extends BaseError {
constructor(message: string) {
super(`Script error: ${message}`);
}
}
class ParsingError extends BaseError {
constructor(message: string) {
super(`Parsing error: ${message}`);
}
}
class RequiredError extends BaseError {
constructor(name: string) {
super(`Required input "${name}" is missing`);
}
}
export { BaseError, FileNotFoundError, InvalidFileError, InvalidFormatError, ScriptError, ParsingError, RequiredError };