Use the new error classes in code added on master

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-27 22:05:14 +00:00
1 parent 54e9340e61
commit 1a03e66479
4 files changed
+16 -16

No files matched your search

+3 -3
View File
@@ -109,7 +109,7 @@ export default async function(context: ControllerPluginContext) {
let acquisitionRecord = getAcquisition(playerName);
if (acquisitionRecord) {
let instanceName = controller.instances.get(acquisitionRecord.instanceId)!.config.get("instance.name");
throw new lib.RequestError(
throw new lib.ConflictError(
`${playerName} is currently acquired by ${instanceName}, ` +
"have the player leave or release the lock first"
);
@@ -340,7 +340,7 @@ export default async function(context: ControllerPluginContext) {
controller.handle(msg.DeletePlayerDataRequest, async (request: msg.DeletePlayerDataRequest) => {
let { playerName } = request;
if (!playerDatastore.has(playerName)) {
throw new lib.RequestError(`No player data stored for ${playerName}`);
throw new lib.NotFoundError(`No player data stored for ${playerName}`);
}
checkNotAcquired(playerName);
@@ -354,7 +354,7 @@ export default async function(context: ControllerPluginContext) {
controller.handle(msg.ForceReleaseRequest, async (request: msg.ForceReleaseRequest) => {
let { playerName } = request;
if (!acquiredPlayers.delete(playerName)) {
throw new lib.RequestError(`${playerName} is not acquired by any instance`);
throw new lib.ConflictError(`${playerName} is not acquired by any instance`);
}
logger.info(`Released lock on ${playerName}`);
});