mirror of
https://github.com/michivonah/themepark-assistant.git
synced 2025-12-22 22:16:29 +01:00
create base error class & unified error import #3
This commit is contained in:
parent
04ae271e1e
commit
6b61bd0df3
4 changed files with 29 additions and 15 deletions
14
api/src/errors/lib-error.ts
Normal file
14
api/src/errors/lib-error.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue