ax(mining): replace prose comment with usage example on respondWithMiningError
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:
parent
acef50ad62
commit
abd4335935
1 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue