ax(mining): replace prose comment with usage example on respondWithMiningError
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

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 <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 16:37:20 +01:00
parent acef50ad62
commit abd4335935
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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 {