create base error class & unified error import #3

This commit is contained in:
Michi 2025-10-11 12:43:48 +02:00
parent 04ae271e1e
commit 6b61bd0df3
4 changed files with 29 additions and 15 deletions

View file

@ -0,0 +1,14 @@
// Errors in custom libs
import { BaseError } from "./base-error";
export class LibError extends BaseError{}
export class FetchError extends LibError{
constructor(cause?: unknown, source?: string){
super(
source
? `Fetching data from ${source} failed`
: 'Fetching data failed',
cause);
}
}