summaryrefslogtreecommitdiff
path: root/alarm/node_modules/pronote-api/src/errors.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-01-10 14:54:04 +0100
committerMinteck <contact@minteck.org>2023-01-10 14:54:04 +0100
commit99c1d9af689e5325f3cf535c4007b3aeb8325229 (patch)
treee663b3c2ebdbd67c818ac0c5147f0ce1d2463cda /alarm/node_modules/pronote-api/src/errors.js
parent9871b03912fc28ad38b4037ebf26a78aa937baba (diff)
downloadpluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.tar.gz
pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.tar.bz2
pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.zip
Update - This is an automated commit
Diffstat (limited to 'alarm/node_modules/pronote-api/src/errors.js')
-rw-r--r--alarm/node_modules/pronote-api/src/errors.js30
1 files changed, 0 insertions, 30 deletions
diff --git a/alarm/node_modules/pronote-api/src/errors.js b/alarm/node_modules/pronote-api/src/errors.js
deleted file mode 100644
index 5bb6e17..0000000
--- a/alarm/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
-};