diff options
author | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
commit | 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch) | |
tree | 75be5fba4368472fb11c8015aee026b2b9a71888 /school/node_modules/pronote-api/src/errors.js | |
parent | 8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff) | |
download | pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2 pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip |
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'school/node_modules/pronote-api/src/errors.js')
-rw-r--r-- | school/node_modules/pronote-api/src/errors.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/school/node_modules/pronote-api/src/errors.js b/school/node_modules/pronote-api/src/errors.js deleted file mode 100644 index 5bb6e17..0000000 --- a/school/node_modules/pronote-api/src/errors.js +++ /dev/null @@ -1,30 +0,0 @@ -const PRONOTE = error(-1, ({ title, message }) => title + (title && message ? ' - ' : '') + message); -const UNKNOWN_CAS = error(1, cas => `Unknown CAS '${cas}' (use 'none' for no CAS)`); -const BANNED = error(2, 'Your IP address is temporarily banned because of too many failed authentication attempts'); -const WRONG_CREDENTIALS = error(3, 'Wrong user credentials'); -const UNKNOWN_ACCOUNT = error(4, typeAccount => `Unknown account type '${typeAccount}'`); -const SESSION_EXPIRED = error(5, 'Session has expired due to inactivity or error'); -const RATE_LIMITED = error(6, 'You are being rate limited because of too many failed requests'); -const CLOSED = error(7, 'The instance is closed, try again later'); - -function error(code, message) -{ - return { - code, - drop: (...args) => ({ - code, - message: typeof message === 'string' ? message : message(...args) - }) - } -} - -module.exports = { - PRONOTE, - UNKNOWN_CAS, - BANNED, - WRONG_CREDENTIALS, - UNKNOWN_ACCOUNT, - SESSION_EXPIRED, - RATE_LIMITED, - CLOSED -}; |