{"record":{"id":"204b8dae7e656f04","repo":"affaan-m/ECC","slug":"errconflict","errorCode":"ErrConflict","errorMessage":"conflict","messagePattern":"conflict","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"skills/error-handling/SKILL.md","lineNumber":267,"sourceCode":"        status_code=500,\n        content={\"error\": {\"code\": \"INTERNAL_ERROR\", \"message\": \"An unexpected error occurred\"}},\n    )\n```\n\n## Go\n\n### Sentinel Errors and Error Wrapping\n\n```go\npackage domain\n\nimport \"errors\"\n\n// Sentinel errors for type-checking\nvar (\n    ErrNotFound    = errors.New(\"not found\")\n    ErrUnauthorized = errors.New(\"unauthorized\")\n    ErrConflict     = errors.New(\"conflict\")\n)\n\n// Wrap errors with context — never lose the original\nfunc (r *UserRepository) FindByID(ctx context.Context, id string) (*User, error) {\n    user, err := r.db.QueryRow(ctx, \"SELECT * FROM users WHERE id = $1\", id)\n    if errors.Is(err, sql.ErrNoRows) {\n        return nil, fmt.Errorf(\"user %s: %w\", id, ErrNotFound)\n    }\n    if err != nil {\n        return nil, fmt.Errorf(\"querying user %s: %w\", id, err)\n    }\n    return user, nil\n}\n\n// At the handler level, unwrap to determine response\nfunc (h *Handler) GetUser(w http.ResponseWriter, r *http.Request) {\n    user, err := h.service.GetUser(r.Context(), chi.URLParam(r, \"id\"))\n    if err != nil {","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/skills/error-handling/SKILL.md#L249-L285","documentation":"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.","triggerScenarios":"Triggered when SKILL.md rejects the current invocation: conflict","commonSituations":"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.","solutions":["Review the constraint in the error message, correct the input accordingly, and re-run."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}