{"record":{"id":"64fb0173df3d26a9","repo":"pbakaus/impeccable","slug":"message","errorCode":null,"errorMessage":"{message}\n","messagePattern":"\\{message\\}\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/detect/src/ignores.rs","lineNumber":563,"sourceCode":"    let out = match action {\n        \"list\" => Ok(list(&cwd)),\n        \"add-rule\" => add_rule(&cwd, &rest),\n        \"add-file\" => add_file(&cwd, &rest),\n        \"add-value\" => add_value(&cwd, &rest),\n        \"remove-rule\" => remove_rule(&cwd, &rest),\n        \"remove-file\" => remove_file(&cwd, &rest),\n        \"remove-value\" => remove_value(&cwd, &rest),\n        _ => clear(&cwd, &rest),\n    };\n    match out {\n        Ok(text) => {\n            if !text.is_empty() {\n                io.out(&format!(\"{text}\\n\"));\n            }\n            0\n        }\n        Err(message) => {\n            io.err(&format!(\"{message}\\n\"));\n            1\n        }\n    }\n}\n","sourceCodeStart":545,"sourceCodeEnd":568,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/detect/src/ignores.rs#L545-L568","documentation":"In ignores::run, after an action executes, an Err(message) from the action handler (add-rule, remove-file, clear, etc.) is printed verbatim to stderr followed by a newline, and the process exits with code 1. This is the generic failure sink for all ignores sub-actions; the actual reason lives in the wrapped message (e.g. missing argument, config write failure).","triggerScenarios":"Any `impeccable ignores <action> ...` invocation whose handler returns Err — typically calling add-rule/add-file/add-value without a value argument, or a failure reading/writing the shared or local detection config file.","commonSituations":"Forgetting the rule/file/value argument after the action; a read-only config file or unwritable project directory blocking config writes; malformed existing detection config that fails to parse when adding an entry.","solutions":["Read the message printed after this prefix — it names the specific failing action and reason","Supply the missing argument, e.g. `impeccable ignores add-rule <rule-id>` instead of a bare `add-rule`","Check write permissions on the config location (shared vs local scope) if the message mentions writing","Run `impeccable ignores list` first to verify the config parses and see current entries"],"exampleFix":"// before\n$ impeccable ignores add-rule\nError: ...\n\n// after\n$ impeccable ignores add-rule suspicious-pattern","handlingStrategy":"validation","validationCode":"const needsArg = ['add-rule','add-file','add-value','remove-rule','remove-value'];\nif (needsArg.includes(action) && restArgs.length === 0) {\n  throw new Error(`impeccable ignores ${action} requires an argument`);\n}","typeGuard":null,"tryCatchPattern":"// ignores action failures print the reason on stderr, exit 1\nconst res = spawnSync('impeccable', ['ignores', action, value]);\nif (res.status !== 0) {\n  console.error('ignores failed:', res.stderr.toString().trim());\n}","preventionTips":["Provide the rule/file/value argument immediately after the action","Ensure the config file location is writable before mutating ignores","Run `impeccable ignores list` to confirm the config parses before adding entries"],"tags":["cli","config","argument-parsing"],"backgroundTag":"invalid-cli-argument","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}