{"record":{"id":"895a6e4210101183","repo":"jdx/mise","slug":"brew-cask-kind-terminate-process-notices-mus","errorCode":null,"errorMessage":"brew-cask:{}: {kind} terminate_process notices must be an array","messagePattern":"brew-cask:(.+?): (.+?) terminate_process notices must be an array","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":5764,"sourceCode":"                            \"brew-cask:{}: {kind} terminate_process attempts must be a positive integer\",\n                            cask.token\n                        )\n                    })?,\n            };\n            let notices = match object.get(\"notices\") {\n                None => Vec::new(),\n                Some(Value::Array(values)) => values\n                    .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,","sourceCodeStart":5746,"sourceCodeEnd":5782,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L5746-L5782","documentation":"Thrown while parsing a terminate_process step. The optional 'notices' key must be an array of strings (user-facing notes shown before the process is terminated). Supplying any non-array JSON value — a bare string, number, or object — hits the Some(_) arm and bails. (Array entries that are not strings produce the sibling 'notices must be strings' error.)","triggerScenarios":"{\"type\": \"terminate_process\", \"name\": \"x\", \"notices\": \"closing app\"} or \"notices\": {\"text\": \"...\"} inside a preflight/postflight step.","commonSituations":"Authors writing a single notice as a plain string instead of a one-element array; config templating that renders a scalar when the list has one item.","solutions":["Wrap notices in an array of strings: \"notices\": [\"This will close the app\"]","Omit the key entirely if there are no notices (it defaults to an empty list)"],"exampleFix":"// before\n{\"type\": \"terminate_process\", \"name\": \"x\", \"notices\": \"will restart the app\"}\n// after\n{\"type\": \"terminate_process\", \"name\": \"x\", \"notices\": [\"will restart the app\"]}","handlingStrategy":"validation","validationCode":"fn notices_ok(step: &serde_json::Value) -> bool {\n    match step.get(\"notices\") {\n        None => true,\n        Some(serde_json::Value::Array(_)) => 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(\"notices must be an array\") => {\n        eprintln!(\"wrap each notice in a one-element array of strings\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always emit notices as arrays, even for a single message","Check that templating does not collapse one-element lists to scalars"],"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"}