{"record":{"id":"c3b7442947511847","repo":"jdx/mise","slug":"brew-cask-kind-terminate-process-notices-mus-c3b744","errorCode":null,"errorMessage":"brew-cask:{}: {kind} terminate_process notices must be an array","messagePattern":"brew-cask:(.+?): (.+?) terminate_process notices must be an array","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/artifacts.rs","lineNumber":808,"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":790,"sourceCodeEnd":826,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/artifacts.rs#L790-L826","documentation":"The `notices` field of a `terminate_process` flight step must be an array of strings. When `notices` is present but is any other JSON/TOML type (string, object, number, bool), the parser bails with this error rather than guessing an interpretation.","triggerScenarios":"A cask sets `notices = \"some message\"` (a plain string instead of an array), or an object/number/bool, in a terminate_process step; parse_flight_step's `Some(_)` arm fires.","commonSituations":"Author confusion between singular 'notice' string vs plural 'notices' array; conversion tools that collapse a single-element list; hand-editing and dropping the brackets.","solutions":["Wrap the message in an array: `notices = [\"msg\"]`.","Remove the `notices` key if no notices are needed.","Ensure every element of the array is a string (see the related 'notices must be strings' error)."],"exampleFix":"// before\n[[install.flight_steps]]\ntype = \"terminate_process\"\nname = \"MyApp\"\nnotices = \"Please close MyApp\"\n// after\n[[install.flight_steps]]\ntype = \"terminate_process\"\nname = \"MyApp\"\nnotices = [\"Please close MyApp\"]","handlingStrategy":"type-guard","validationCode":"function validateNotices(step) {\n  if ('notices' in step && !Array.isArray(step.notices)) {\n    throw new Error(`terminate_process notices must be an array of strings, got ${typeof step.notices}`);\n  }\n}","typeGuard":"const isNoticesArray = (n) => n === undefined || (Array.isArray(n) && n.every((x) => typeof x === 'string'));","tryCatchPattern":"try {\n  parseFlightStep(raw);\n} catch (e) {\n  if (String(e).includes('notices must be an array')) {\n    fix.notices = [String(raw.notices)];\n  } else throw e;\n}","preventionTips":["Always use an array for `notices`, even for a single message.","Don't confuse a single-string convenience form with the actual schema.","Run schema validation (e.g. JSON Schema) on cask files before install."],"tags":["brew-cask","config-validation","type-mismatch"],"backgroundTag":"type-mismatch","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}