{"record":{"id":"320c7bf9c9e2db4b","repo":"jdx/mise","slug":"brew-cask-kind-terminate-process-failure-mes","errorCode":null,"errorMessage":"brew-cask:{}: {kind} terminate_process failure_message must be a string","messagePattern":"brew-cask:(.+?): (.+?) terminate_process failure_message must be a string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":5772,"sourceCode":"                    .iter()\n                    .map(|value| {\n                        value.as_str().map(str::to_string).ok_or_else(|| {\n                            eyre!(\n                                \"brew-cask:{}: {kind} terminate_process notices must be strings\",\n                                cask.token\n                            )\n                        })\n                    })\n                    .collect::<Result<Vec<_>>>()?,\n                Some(_) => bail!(\n                    \"brew-cask:{}: {kind} terminate_process notices must be an array\",\n                    cask.token\n                ),\n            };\n            let failure_message = match object.get(\"failure_message\") {\n                None | Some(Value::Null) => None,\n                Some(Value::String(value)) => Some(value.clone()),\n                Some(_) => bail!(\n                    \"brew-cask:{}: {kind} terminate_process failure_message must be a string\",\n                    cask.token\n                ),\n            };\n            Ok(FlightStep::TerminateProcess {\n                name: name.to_string(),\n                match_mode,\n                sudo,\n                attempts,\n                must_succeed,\n                notices,\n                failure_message,\n            })\n        }\n        _ => bail!(\n            \"brew-cask:{}: unsupported {kind} step type {}\",\n            cask.token,\n            step_type","sourceCodeStart":5754,"sourceCodeEnd":5790,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L5754-L5790","documentation":"Thrown while parsing a terminate_process step. The optional 'failure_message' may be absent or null (becomes None) or a string shown when termination fails; any other JSON type (number, bool, array, object) is rejected so the failure path always has displayable text.","triggerScenarios":"{\"type\": \"terminate_process\", \"name\": \"x\", \"failure_message\": 42} or \"failure_message\": [\"msg\"] inside preflight_steps/postflight_steps.","commonSituations":"Numeric exit-code-like values or nested objects put where a message string belongs; generators emitting structured messages ({\"text\": ...}) instead of plain strings.","solutions":["Make failure_message a plain string: \"failure_message\": \"Could not stop x; continue manually\"","Or remove the key / set it to null when no custom failure text is needed"],"exampleFix":"// before\n{\"type\": \"terminate_process\", \"name\": \"x\", \"failure_message\": {\"text\": \"failed\"}}\n// after\n{\"type\": \"terminate_process\", \"name\": \"x\", \"failure_message\": \"failed\"}","handlingStrategy":"validation","validationCode":"fn failure_message_ok(step: &serde_json::Value) -> bool {\n    match step.get(\"failure_message\") {\n        None | Some(serde_json::Value::Null) => true,\n        Some(serde_json::Value::String(_)) => true,\n        Some(_) => false,\n    }\n}","typeGuard":null,"tryCatchPattern":"match parse_flight_step(&cask, kind, &step) {\n    Ok(step) => { /* proceed */ }\n    Err(e) if e.to_string().contains(\"failure_message must be a string\") => {\n        eprintln!(\"failure_message must be a plain string or null\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep failure_message a flat string; never a structured object","Omit the key when the default failure text is acceptable"],"tags":["brew-cask","mise","terminate-process","type-mismatch","flight-steps"],"backgroundTag":"brew-cask-stanza-validation","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}