Improved error reporting

This commit is contained in:
Endeavorance 2025-02-25 16:12:53 -05:00
parent d4eb0c8a4f
commit 91813b4165
5 changed files with 48 additions and 17 deletions

20
src/errors.ts Normal file
View file

@ -0,0 +1,20 @@
export class MuseError extends Error {
fmt(): string {
return this.message;
}
}
export class ResourceFileError extends MuseError {
filePath: string;
details?: string;
constructor(message: string, filePath: string, details?: string) {
super(message);
this.filePath = filePath;
this.details = details;
}
fmt(): string {
return `-- ${this.message} --\nFile Path: ${this.filePath}\nDetails: ${this.details}`;
}
}