-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add BaseError and JobError classes to handle custom errors
- Loading branch information
1 parent
313f929
commit b2f7092
Showing
6 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export class BaseError extends Error { | ||
constructor(public message: string) { | ||
super(message); | ||
this.name = this.constructor.name; | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
} | ||
} | ||
|
||
export class JobError extends BaseError { | ||
constructor(public message: string) { | ||
super(message); | ||
this.name = this.constructor.name; | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./create-job"; | ||
export * from "./parse-priority"; | ||
export * from "./process-jobs"; | ||
export * from './create-job'; | ||
export * from './error'; | ||
export * from './parse-priority'; | ||
export * from './process-jobs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters