Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/OpenClaw.Shared/Capabilities/DeviceCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private async Task<NodeInvokeResponse> HandleStatusAsync(NodeInvokeRequest reque
catch (Exception ex)
{
Logger.Warn($"device.status: {section} collection failed: {ex.Message}");
return new { error = ex.Message };
return new { error = "collection failed" };
}
}

Expand All @@ -159,7 +159,7 @@ private async Task<NodeInvokeResponse> HandleStatusAsync(NodeInvokeRequest reque
catch (Exception ex)
{
Logger.Warn($"device.status: {section} collection failed: {ex.Message}");
return new { error = ex.Message };
return new { error = "collection failed" };
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/OpenClaw.Shared/WindowsNodeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ private async Task HandleNodeInvokeEventAsync(JsonElement root)
catch (Exception ex)
{
_logger.Error($"[NODE] Command execution failed: {command}", ex);
await SendNodeInvokeResultAsync(requestId, false, null, $"Execution failed: {ex.Message}");
await SendNodeInvokeResultAsync(requestId, false, null, "Command execution failed");
stopwatch.Stop();
RaiseInvokeCompleted(requestId, command, false, $"Execution failed: {ex.Message}", stopwatch.Elapsed);
RaiseInvokeCompleted(requestId, command, false, "Command execution failed", stopwatch.Elapsed);
}
}

Expand Down Expand Up @@ -1003,9 +1003,9 @@ private async Task HandleNodeInvokeAsync(JsonElement root, string? requestId)
catch (Exception ex)
{
_logger.Error($"Command execution failed: {command}", ex);
await SendErrorResponseAsync(requestId, $"Execution failed: {ex.Message}");
await SendErrorResponseAsync(requestId, "Command execution failed");
stopwatch.Stop();
RaiseInvokeCompleted(requestId, command, false, $"Execution failed: {ex.Message}", stopwatch.Elapsed);
RaiseInvokeCompleted(requestId, command, false, "Command execution failed", stopwatch.Elapsed);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Task<ExecApprovalPromptDecision> RequestAsync(
catch (Exception ex)
{
_logger.Warn($"[ExecApproval] Prompt failed: {ex.Message}");
tcs.TrySetResult(ExecApprovalPromptDecision.Deny($"Prompt failed: {ex.Message}"));
tcs.TrySetResult(ExecApprovalPromptDecision.Deny("Approval prompt failed"));
}
}))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public Task<UrlNavigationApprovalDecision> RequestAsync(
catch (Exception ex)
{
_logger.Warn($"[NavigationApproval] Prompt failed: {ex.Message}");
return UrlNavigationApprovalDecision.Deny($"Prompt failed: {ex.Message}");
return UrlNavigationApprovalDecision.Deny("Approval prompt failed");
}
}, cancellationToken);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/OpenClaw.Shared.Tests/CapabilityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ public async Task Status_BatterySection_GracefulOnFailure()
Assert.True(res.Ok);
var battery = GetPayload(res).GetProperty("battery");
Assert.NotEqual(JsonValueKind.Undefined, battery.GetProperty("error").ValueKind);
Assert.Contains("No battery hardware", battery.GetProperty("error").GetString());
Assert.Equal("collection failed", battery.GetProperty("error").GetString());
// Legacy fields must still be present for backward compat
Assert.True(battery.TryGetProperty("level", out _), "battery.level missing on failure path");
Assert.Equal("unknown", battery.GetProperty("state").GetString());
Expand Down
Loading