diff options
| author | Haishan <[email protected]> | 2020-10-31 18:18:04 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2020-11-01 17:42:52 +0800 |
| commit | ff1a39d04e53b428e34d46c55ecd6689189b5443 (patch) | |
| tree | 94a60abe3d28a1d729b877356bdd38d75ce655a5 /src/misc/errors.js | |
| parent | e62c9165481ef12ee2310dee1c32f890b3fe4b78 (diff) | |
chore: run ts-migrate
Diffstat (limited to 'src/misc/errors.js')
| -rw-r--r-- | src/misc/errors.js | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/misc/errors.js b/src/misc/errors.js deleted file mode 100644 index 1891aa0..0000000 --- a/src/misc/errors.js +++ /dev/null @@ -1,19 +0,0 @@ -export const DOES_NOT_SUPPORT_FETCH = 0; - -export const errors = { - [DOES_NOT_SUPPORT_FETCH]: { - message: 'Browser not supported!', - detail: 'This browser does not support "fetch", please choose another one.' - }, - default: { - message: 'Oops, something went wrong!' - } -}; - -export function deriveMessageFromError(err) { - const { code } = err; - if (typeof code === 'number') { - return errors[code]; - } - return errors.default; -} |
