Problem
Several error returns are silently discarded in non-cleanup code paths:
-
`internal/controlplane/server.go:282` — `_ = json.NewEncoder(w).Encode(v)` swallows JSON serialization errors. If encoding fails, the client gets a partial/empty response with a 200 status.
-
`internal/controlplane/grpc.go:403` — `_ = s.server.store.DeletePolicy(ctx, policy.ID)` ignores deletion failures during a policy sync rollback. If the rollback fails, the system is in an inconsistent state with no signal.
Fix
- For JSON encoding: check the error and log it (response is already partially written, so can't change status code, but should log)
- For policy deletion rollback: log the error at `error` level with the policy ID so operators can investigate
Acceptance Criteria
Problem
Several error returns are silently discarded in non-cleanup code paths:
`internal/controlplane/server.go:282` — `_ = json.NewEncoder(w).Encode(v)` swallows JSON serialization errors. If encoding fails, the client gets a partial/empty response with a 200 status.
`internal/controlplane/grpc.go:403` — `_ = s.server.store.DeletePolicy(ctx, policy.ID)` ignores deletion failures during a policy sync rollback. If the rollback fails, the system is in an inconsistent state with no signal.
Fix
Acceptance Criteria