Replace RequestError with the HTTP-style error classes

clusterio#999 removed RequestError. Handlers now throw NotFoundError,
ValidationError, ConflictError or UnavailableError, and exp_auto_restart
treats any ClientError from the host as a final refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-28 23:43:25 +00:00
1 parent afc1d35668
commit 389004d652
8 files changed
+32 -32

No files matched your search

+2 -2
View File
@@ -175,7 +175,7 @@ export default async function (context: ControllerPluginContext) {
const rolesPlugin = RolesPlugin.get(controller);
const groupsPlugin = GroupsPlugin.get(controller);
if (!rolesPlugin || !groupsPlugin) {
throw new lib.RequestError("Seeding requires the exp_roles and exp_groups plugins");
throw new lib.UnavailableError("Seeding requires the exp_roles and exp_groups plugins");
}
const roleIds = new Map<string, number>();
@@ -214,7 +214,7 @@ export default async function (context: ControllerPluginContext) {
try {
values = validateFeatureValues(request.id, request.values);
} catch (err: any) {
throw new lib.RequestError(err.message);
throw new lib.ValidationError(err.message);
}
const feature = new messages.FeatureRecord(request.id, request.enabled, values);