diff options
| author | Matain <[email protected]> | 2022-06-12 23:34:56 +0800 |
|---|---|---|
| committer | Matain <[email protected]> | 2022-06-12 23:34:56 +0800 |
| commit | ea5d7cf003eeef30cb7bbe789c6ba7f314bf1ce4 (patch) | |
| tree | bff1bd7b0e8e8eb753d373b57f007bbe97f96c76 /src/misc/errors.ts | |
| parent | 4fd2c8f646e48dd0c07d0c2041de52e9a4f8bc82 (diff) | |
| parent | 38571da24ac54137564be5e41b7a409009e2ee10 (diff) | |
Merge branch 'master' of https://github.com/haishanh/yacd into haishanh-master
Diffstat (limited to 'src/misc/errors.ts')
| -rw-r--r-- | src/misc/errors.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/misc/errors.ts b/src/misc/errors.ts index 1bc369a..ec12b6a 100644 --- a/src/misc/errors.ts +++ b/src/misc/errors.ts @@ -1,5 +1,12 @@ export const DOES_NOT_SUPPORT_FETCH = 0; +export class YacdError extends Error { + constructor(public message: string, public code?: string | number) { + super(message); + Error.captureStackTrace(this, this.constructor); + } +} + export const errors = { [DOES_NOT_SUPPORT_FETCH]: { message: 'Browser not supported!', |
