feat(stability): unify readiness and recovery
CI - Build & Test / Backend (.NET) (push) Successful in 45s
CI - Build & Test / Backend integration (PostgreSQL/Toxiproxy) (push) Failing after 1m0s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m49s
CI - Build & Test / Security Check (push) Successful in 7s
CI - Build & Test / Deploy Nexus (push) Has been skipped
CI - Build & Test / Backend (.NET) (push) Successful in 45s
CI - Build & Test / Backend integration (PostgreSQL/Toxiproxy) (push) Failing after 1m0s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m49s
CI - Build & Test / Security Check (push) Successful in 7s
CI - Build & Test / Deploy Nexus (push) Has been skipped
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Nexus.Api.Models;
|
||||
using Nexus.Api.Http;
|
||||
using Nexus.Api.Services;
|
||||
|
||||
namespace Nexus.Api.Controllers;
|
||||
@@ -28,21 +28,32 @@ internal static class OpenClawContentReadEndpoint
|
||||
"disconnected" => StatusCodes.Status503ServiceUnavailable,
|
||||
_ => StatusCodes.Status409Conflict
|
||||
};
|
||||
return Results.Json(
|
||||
new OpenClawAgentConfigurationErrorDto(
|
||||
exception.State,
|
||||
exception.Message,
|
||||
exception.Method,
|
||||
exception.RequiredScope),
|
||||
statusCode: status);
|
||||
return NexusHttpResults.Problem(
|
||||
status,
|
||||
exception.Message,
|
||||
status switch
|
||||
{
|
||||
StatusCodes.Status403Forbidden => NexusProblemCodes.Forbidden,
|
||||
StatusCodes.Status503ServiceUnavailable => NexusProblemCodes.DependencyUnavailable,
|
||||
_ => NexusProblemCodes.Conflict
|
||||
},
|
||||
extensions: new Dictionary<string, object?>
|
||||
{
|
||||
["method"] = exception.Method,
|
||||
["requiredScope"] = exception.RequiredScope,
|
||||
["state"] = exception.State
|
||||
});
|
||||
}
|
||||
catch (OpenClawAgentConfigurationVerificationException)
|
||||
{
|
||||
return Results.Json(
|
||||
new OpenClawAgentConfigurationErrorDto(
|
||||
"verification_failed",
|
||||
"OpenClaw-Antwort konnte nicht sicher verifiziert werden."),
|
||||
statusCode: StatusCodes.Status502BadGateway);
|
||||
return NexusHttpResults.Problem(
|
||||
StatusCodes.Status502BadGateway,
|
||||
"OpenClaw-Antwort konnte nicht sicher verifiziert werden.",
|
||||
NexusProblemCodes.DependencyUnavailable,
|
||||
extensions: new Dictionary<string, object?>
|
||||
{
|
||||
["state"] = "verification_failed"
|
||||
});
|
||||
}
|
||||
catch (OpenClawGatewayRpcException exception)
|
||||
{
|
||||
@@ -60,22 +71,33 @@ internal static class OpenClawContentReadEndpoint
|
||||
StatusCodes.Status504GatewayTimeout,
|
||||
_ => StatusCodes.Status502BadGateway
|
||||
};
|
||||
return Results.Json(
|
||||
new OpenClawAgentConfigurationErrorDto(
|
||||
code.ToLowerInvariant(),
|
||||
status switch
|
||||
{
|
||||
StatusCodes.Status403Forbidden =>
|
||||
"OpenClaw hat Nexus nicht die erforderliche Leseberechtigung gewährt.",
|
||||
StatusCodes.Status409Conflict =>
|
||||
"Die verbundene OpenClaw-Version unterstützt diese Leseoperation nicht.",
|
||||
StatusCodes.Status503ServiceUnavailable =>
|
||||
"OpenClaw Gateway ist nicht verfügbar.",
|
||||
StatusCodes.Status504GatewayTimeout =>
|
||||
"OpenClaw hat nicht rechtzeitig geantwortet.",
|
||||
_ => "OpenClaw-Leseoperation ist fehlgeschlagen."
|
||||
}),
|
||||
statusCode: status);
|
||||
var problemCode = status switch
|
||||
{
|
||||
StatusCodes.Status403Forbidden => NexusProblemCodes.Forbidden,
|
||||
StatusCodes.Status409Conflict => NexusProblemCodes.UnsupportedCapability,
|
||||
StatusCodes.Status503ServiceUnavailable => NexusProblemCodes.DependencyUnavailable,
|
||||
StatusCodes.Status504GatewayTimeout => NexusProblemCodes.Timeout,
|
||||
_ => NexusProblemCodes.DependencyUnavailable
|
||||
};
|
||||
return NexusHttpResults.Problem(
|
||||
status,
|
||||
status switch
|
||||
{
|
||||
StatusCodes.Status403Forbidden =>
|
||||
"OpenClaw hat Nexus nicht die erforderliche Leseberechtigung gewährt.",
|
||||
StatusCodes.Status409Conflict =>
|
||||
"Die verbundene OpenClaw-Version unterstützt diese Leseoperation nicht.",
|
||||
StatusCodes.Status503ServiceUnavailable =>
|
||||
"OpenClaw Gateway ist nicht verfügbar.",
|
||||
StatusCodes.Status504GatewayTimeout =>
|
||||
"OpenClaw hat nicht rechtzeitig geantwortet.",
|
||||
_ => "OpenClaw-Leseoperation ist fehlgeschlagen."
|
||||
},
|
||||
problemCode,
|
||||
extensions: new Dictionary<string, object?>
|
||||
{
|
||||
["state"] = code.ToLowerInvariant()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user