Restore error message constants

This commit is contained in:
seditionist
2023-11-26 17:42:55 -05:00
parent 5483e54d78
commit 66528cd9d9

View File

@@ -280,11 +280,15 @@ export const FORMATTED_SOUL_WARS = 'Soul Wars Zeal';
export const FORMATTED_LEAGUE_POINTS = 'League Points';
export const FORMATTED_RIFTS_CLOSED = 'Rifts closed';
export const INVALID_FORMAT_ERROR = 'Invalid hiscores format';
export const PLAYER_NOT_FOUND_ERROR = 'Player not found';
export const HISCORES_ERROR = 'HiScores not responding';
export class InvalidFormatError extends Error {
__proto__ = Error;
constructor() {
super('Invalid hiscores format');
super(INVALID_FORMAT_ERROR);
Object.setPrototypeOf(this, InvalidFormatError.prototype);
}
}
@@ -302,7 +306,7 @@ export class PlayerNotFoundError extends Error {
__proto__ = Error;
constructor() {
super('Player not found');
super(PLAYER_NOT_FOUND_ERROR);
Object.setPrototypeOf(this, PlayerNotFoundError.prototype);
}
}
@@ -311,7 +315,7 @@ export class HiScoresError extends Error {
__proto__ = Error;
constructor() {
super('HiScores not responding');
super(HISCORES_ERROR);
Object.setPrototypeOf(this, HiScoresError.prototype);
}
}
}