Add UnavailableError and keep the PermissionError name

Host not connected, host shutting down and instance not running are
now UnavailableError (503) instead of ConflictError. The request error
migration notes move to a new 2.1 guide, since this ships in 2.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-27 22:03:13 +00:00
1 parent 1c7c00b033
commit 54e9340e61
23 files changed
+78 -66

No files matched your search

+2 -2
View File
@@ -203,7 +203,7 @@ export class HostRouter {
return false;
}
origin.connector.sendResponseError(
new lib.ResponseError(msg || "Instance is not running.", "ConflictError"), message.src
new lib.ResponseError(msg || "Instance is not running.", "UnavailableError"), message.src
);
}
return true;
@@ -271,7 +271,7 @@ export class HostRouter {
}
if (this.host._shuttingDown) {
origin.connector.sendResponseError(
new lib.ResponseError("Host is shutting down.", "ConflictError"), message.src
new lib.ResponseError("Host is shutting down.", "UnavailableError"), message.src
);
return;
}
+2 -2
View File
@@ -1422,7 +1422,7 @@ end`.replace(/\r?\n/g, " ");
async handleInstanceSaveGameRequest() {
if (this._status !== "running") {
throw new lib.ConflictError("Instance is not running");
throw new lib.UnavailableError("Instance is not running");
}
const saved = new Promise<void>((resolve, reject) => {
@@ -1432,7 +1432,7 @@ end`.replace(/\r?\n/g, " ");
};
const onExit = () => {
this.server.off("save-finished", onSaved);
reject(new lib.ConflictError("Instance stopped before the save finished"));
reject(new lib.UnavailableError("Instance stopped before the save finished"));
};
this.server.once("save-finished", onSaved);
this.server.once("exit", onExit);