affaan-m/ECC · error

ErrConflict

ErrConflict

Error message

conflict

What it means

Sentinel error example in the error-handling skill documentation (Go section): ErrConflict is the idiomatic sentinel for conflicting-state failures (e.g. duplicate resource) checked with errors.Is. Mirrored in the ja-JP translation; documentation code, not a runtime throw site.

Source

Thrown at skills/error-handling/SKILL.md:267

        status_code=500,
        content={"error": {"code": "INTERNAL_ERROR", "message": "An unexpected error occurred"}},
    )
```

## Go

### Sentinel Errors and Error Wrapping

```go
package domain

import "errors"

// Sentinel errors for type-checking
var (
    ErrNotFound    = errors.New("not found")
    ErrUnauthorized = errors.New("unauthorized")
    ErrConflict     = errors.New("conflict")
)

// Wrap errors with context — never lose the original
func (r *UserRepository) FindByID(ctx context.Context, id string) (*User, error) {
    user, err := r.db.QueryRow(ctx, "SELECT * FROM users WHERE id = $1", id)
    if errors.Is(err, sql.ErrNoRows) {
        return nil, fmt.Errorf("user %s: %w", id, ErrNotFound)
    }
    if err != nil {
        return nil, fmt.Errorf("querying user %s: %w", id, err)
    }
    return user, nil
}

// At the handler level, unwrap to determine response
func (h *Handler) GetUser(w http.ResponseWriter, r *http.Request) {
    user, err := h.service.GetUser(r.Context(), chi.URLParam(r, "id"))
    if err != nil {

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Review the constraint in the error message, correct the input accordingly, and re-run.
Defensive patterns

Strategy: validation

When it happens

Trigger: Triggered when SKILL.md rejects the current invocation: conflict

Common situations: Occurs while running skills/error-handling/SKILL.md with invalid arguments, missing flags, or a failing external dependency; the guard at skills/error-handling/SKILL.md:267 aborts the command with this message.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/204b8dae7e656f04. Report an issue: GitHub.