From abd4335935cbb036b19f56fb99ae279ec6cc623a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 16:37:20 +0100 Subject: [PATCH] ax(mining): replace prose comment with usage example on respondWithMiningError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AX Principle 2 — comments show HOW with real values, not WHAT the function does. "sends a structured error response" restates the signature; replaced with two concrete call-site examples showing realistic arguments. Co-Authored-By: Charon --- pkg/mining/service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/mining/service.go b/pkg/mining/service.go index 3abe30e..08f8883 100644 --- a/pkg/mining/service.go +++ b/pkg/mining/service.go @@ -100,8 +100,8 @@ func respondWithError(c *gin.Context, status int, code string, message string, d c.JSON(status, apiErr) } -// respondWithMiningError sends a structured error response from a MiningError. -// This allows using pre-built error constructors from errors.go. +// respondWithMiningError(c, ErrMinerNotFound("xmrig")) +// respondWithMiningError(c, ErrInternal("failed to read config").WithCause(err)) func respondWithMiningError(c *gin.Context, err *MiningError) { details := "" if err.Cause != nil {