mirror of
https://github.com/maxswa/osrs-json-hiscores.git
synced 2025-10-15 10:19:04 +00:00
Restore error message constants
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user