2022-06-23 00:32:51 +08:00
|
|
|
/**
|
|
|
|
* @author Marzavec ( https://github.com/marzavec )
|
|
|
|
* @summary Error ID list
|
|
|
|
* @version 1.0.0
|
|
|
|
* @description Exports an object that hold common global error IDs
|
|
|
|
* @module Constants
|
|
|
|
*/
|
|
|
|
|
2020-09-22 13:34:30 +08:00
|
|
|
/* Base error ranges */
|
|
|
|
const GlobalErrors = 10;
|
|
|
|
const JoinErrors = 20;
|
|
|
|
const ChannelErrors = 30;
|
|
|
|
const InviteErrors = 40;
|
2022-06-23 00:32:51 +08:00
|
|
|
const SessionErrors = 50;
|
2020-09-22 13:34:30 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Holds the numeric id values for each error type
|
|
|
|
* @typedef {object} Errors
|
|
|
|
*/
|
2022-06-23 00:32:51 +08:00
|
|
|
export const Errors = {
|
2020-09-22 13:34:30 +08:00
|
|
|
Global: {
|
|
|
|
RATELIMIT: GlobalErrors + 1,
|
|
|
|
UNKNOWN_USER: GlobalErrors + 2,
|
|
|
|
PERMISSION: GlobalErrors + 3,
|
|
|
|
},
|
|
|
|
|
|
|
|
Join: {
|
|
|
|
RATELIMIT: JoinErrors + 1,
|
|
|
|
INVALID_NICK: JoinErrors + 2,
|
|
|
|
ALREADY_JOINED: JoinErrors + 3,
|
|
|
|
NAME_TAKEN: JoinErrors + 4,
|
|
|
|
},
|
|
|
|
|
|
|
|
Channel: {
|
|
|
|
INVALID_NAME: ChannelErrors + 1,
|
|
|
|
INVALID_LENGTH: ChannelErrors + 2,
|
2022-06-23 00:32:51 +08:00
|
|
|
DEY_BANNED: ChannelErrors + 3,
|
2020-09-22 13:34:30 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
Invite: {
|
|
|
|
RATELIMIT: InviteErrors + 1,
|
|
|
|
},
|
2022-06-23 00:32:51 +08:00
|
|
|
|
|
|
|
Session: {
|
|
|
|
BAD_SESSION: SessionErrors + 1,
|
|
|
|
},
|
2020-09-22 13:34:30 +08:00
|
|
|
};
|
2022-06-23 00:32:51 +08:00
|
|
|
|
|
|
|
export default Errors;
|