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
6 changes: 3 additions & 3 deletions src/OpenClaw.Shared/Capabilities/CameraCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private async Task<NodeInvokeResponse> HandleListAsync(NodeInvokeRequest request
catch (Exception ex)
{
Logger.Error("Camera list failed", ex);
return Error($"List failed: {ex.Message}");
return Error("List failed");
}
}

Expand Down Expand Up @@ -106,7 +106,7 @@ private async Task<NodeInvokeResponse> HandleSnapAsync(NodeInvokeRequest request
catch (Exception ex)
{
Logger.Error("Camera snap failed", ex);
return Error($"Snap failed: {ex.Message}");
return Error("Snap failed");
}
}

Expand Down Expand Up @@ -147,7 +147,7 @@ private async Task<NodeInvokeResponse> HandleClipAsync(NodeInvokeRequest request
catch (Exception ex)
{
Logger.Error("Camera clip failed", ex);
return Error($"Clip failed: {ex.Message}");
return Error("Clip failed");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/OpenClaw.Shared/Capabilities/LocationCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private async Task<NodeInvokeResponse> HandleGetAsync(NodeInvokeRequest request)
catch (Exception ex)
{
Logger.Error("location.get failed", ex);
return Error($"Location failed: {ex.Message}");
return Error("Location failed");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/OpenClaw.Shared/Capabilities/ScreenCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private async Task<NodeInvokeResponse> HandleCaptureAsync(NodeInvokeRequest requ
catch (Exception ex)
{
Logger.Error("Screen capture failed", ex);
return Error($"Capture failed: {ex.Message}");
return Error("Capture failed");
}
}

Expand Down Expand Up @@ -134,7 +134,7 @@ private async Task<NodeInvokeResponse> HandleRecordAsync(NodeInvokeRequest reque
catch (Exception ex)
{
Logger.Error("Screen recording failed", ex);
return Error($"Recording failed: {ex.Message}");
return Error("Recording failed");
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/OpenClaw.Shared/Capabilities/SystemCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private async Task<NodeInvokeResponse> HandleRunAsync(NodeInvokeRequest request)
{
// Rail 1: no silent fallback β€” handler exceptions become typed denies.
Logger.Error($"[system.run] corr={correlationId} path=v2 handler threw", ex);
v2Result = ExecApprovalV2Result.ValidationFailed($"Handler exception: {ex.Message}");
v2Result = ExecApprovalV2Result.ValidationFailed("Handler exception");
}

Logger.Info($"[system.run] corr={correlationId} decision={v2Result.Code} reason={v2Result.Reason}");
Expand Down Expand Up @@ -413,7 +413,7 @@ private async Task<NodeInvokeResponse> HandleRunAsync(NodeInvokeRequest request)
catch (Exception ex)
{
Logger.Error("system.run failed", ex);
return Error($"Execution failed: {ex.Message}");
return Error("Execution failed");
}
}

Expand Down Expand Up @@ -614,7 +614,7 @@ private NodeInvokeResponse HandleExecApprovalsSet(NodeInvokeRequest request)
catch (Exception ex)
{
Logger.Error("execApprovals.set failed", ex);
return Error($"Failed to update policy: {ex.Message}");
return Error("Failed to update policy");
}
}

Expand Down
8 changes: 4 additions & 4 deletions tests/OpenClaw.Shared.Tests/CapabilityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2082,7 +2082,7 @@ public async Task Capture_ReturnsError_WhenHandlerThrows()
var req = new NodeInvokeRequest { Id = "s5", Command = "screen.snapshot", Args = Parse("""{}""") };
var res = await cap.ExecuteAsync(req);
Assert.False(res.Ok);
Assert.Contains("Display access denied", res.Error);
Assert.Equal("Capture failed", res.Error);
}

[Fact]
Expand Down Expand Up @@ -2327,7 +2327,7 @@ public async Task Record_ReturnsError_WhenHandlerThrows()
var req = new NodeInvokeRequest { Id = "s15", Command = "screen.record", Args = Parse("""{}""") };
var res = await cap.ExecuteAsync(req);
Assert.False(res.Ok);
Assert.Contains("Capture permission denied", res.Error);
Assert.Equal("Recording failed", res.Error);
}
}

Expand Down Expand Up @@ -2457,7 +2457,7 @@ public async Task Snap_ReturnsError_WhenHandlerThrows()
var req = new NodeInvokeRequest { Id = "cam6", Command = "camera.snap", Args = Parse("""{}""") };
var res = await cap.ExecuteAsync(req);
Assert.False(res.Ok);
Assert.Contains("Camera access blocked", res.Error);
Assert.Equal("Snap failed", res.Error);
}

[Fact]
Expand Down Expand Up @@ -2892,7 +2892,7 @@ public async Task Get_ReturnsError_WhenHandlerThrows()
var req = new NodeInvokeRequest { Id = "loc6", Command = "location.get", Args = Parse("""{}""") };
var res = await cap.ExecuteAsync(req);
Assert.False(res.Ok);
Assert.Contains("GPS unavailable", res.Error);
Assert.Equal("Location failed", res.Error);
}

[Fact]
Expand Down
Loading