Files
FWS-DiscordBot/src/core/errors.js
T
BlackAngelTV ef8f09da10 refactor(ui): give every message one friendly, ungendered voice
Members read all replies as one voice, so the wording now lives in one place:
the shared titles, the list marker and the "what to do next" hint come from
src/ui/embeds.js, and every module follows them.

An error explains the cause, recalls the rule and offers the way out instead of
blaming; a success says what happens next. Nothing agrees on the gender of a
person ("utilisateur", "cher/chère", "ravie"), which also keeps the sentences
shorter. Two tests lock the shared titles and reject gendered descriptions.
2026-09-15 16:12:19 +02:00

25 lines
698 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** Error whose message is safe to show to Discord users. */
export class UserFacingError extends Error {
constructor(message, options) {
super(message, options);
this.name = 'UserFacingError';
}
}
export class PermissionDeniedError extends UserFacingError {
constructor(
message = 'Cette action est réservée à l’équipe pour l’instant. Demande à une personne du staff si tu en as besoin.',
) {
super(message);
this.name = 'PermissionDeniedError';
}
}
export class ExternalApiError extends Error {
constructor(service, message, options) {
super(`[${service}] ${message}`, options);
this.name = 'ExternalApiError';
this.service = service;
}
}