mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-21 23:33:12 +09:00
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:
1 parent
afc1d35668
commit
389004d652
8 files changed
+32
-32
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user