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

+3 -3
View File
@@ -9,7 +9,7 @@ import express from "express";
import { fileURLToPath } from "node:url";
import {
ControllerConfig, Address, ConflictError, NotFoundError,
ControllerConfig, Address, ConflictError, NotFoundError, UnavailableError,
InstanceConfig, SystemInfo, Role, ModPack, AccountUpdateEvent,
addPluginConfigFields, renamePermissionPrefix,
} from "@clusterio/lib";
@@ -274,13 +274,13 @@ describe("controller/src/Controller", function() {
mockInstanceConfig.set("instance.assigned_host", 99);
assert.throws(
() => controller.sendRequest(new MockEvent(), Address.fromShorthand({ instanceId: 100 })),
new ConflictError("Host containing instance is not connected")
new UnavailableError("Host containing instance is not connected")
);
});
it("should error on invalid host", function() {
assert.throws(
() => controller.sendRequest(new MockEvent(), Address.fromShorthand({ hostId: 99 })),
new ConflictError("Host is not connected")
new UnavailableError("Host is not connected")
);
});
it("should error on invalid broadcast", function() {