Timeouts: better validations (#438)

* better timeout validations

Signed-off-by: GitHub <noreply@github.com>

* almeida reviews

Signed-off-by: GitHub <noreply@github.com>

* better error handling

Signed-off-by: GitHub <noreply@github.com>

* add missing catch noops

Signed-off-by: GitHub <noreply@github.com>

---------

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
Tiago R 2023-12-28 14:41:32 +00:00 committed by GitHub
parent 047ab872df
commit 8860d4fb22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 9 deletions

View file

@ -9,6 +9,8 @@ export enum ERRORS {
INVALID_USER,
INVALID_MUTE_ROLE_ID,
MUTE_ROLE_ABOVE_ZEP,
USER_ABOVE_ZEP,
USER_NOT_MODERATABLE,
}
export const RECOVERABLE_PLUGIN_ERROR_MESSAGES = {
@ -20,6 +22,8 @@ export const RECOVERABLE_PLUGIN_ERROR_MESSAGES = {
[ERRORS.INVALID_USER]: "Invalid user",
[ERRORS.INVALID_MUTE_ROLE_ID]: "Specified mute role is not valid",
[ERRORS.MUTE_ROLE_ABOVE_ZEP]: "Specified mute role is above Zeppelin in the role hierarchy",
[ERRORS.USER_ABOVE_ZEP]: "Cannot mute user, specified user is above Zeppelin in the role hierarchy",
[ERRORS.USER_NOT_MODERATABLE]: "Cannot mute user, specified user is not moderatable",
};
export class RecoverablePluginError extends Error {