diff options
| author | Matain <[email protected]> | 2022-06-12 23:38:31 +0800 |
|---|---|---|
| committer | Matain <[email protected]> | 2022-06-12 23:38:31 +0800 |
| commit | e4e921e0b93f74bf126ca80cbb83f5e912f73a88 (patch) | |
| tree | ca586f4753f5266ab67051235c7a79370fca1333 /src/misc/errors.ts | |
| parent | a825925cc97d95762634d234ef06be1627a21fb1 (diff) | |
| parent | ea5d7cf003eeef30cb7bbe789c6ba7f314bf1ce4 (diff) | |
Merge branch '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!', |
