{"record":{"id":"e065a6830f04becf","repo":"jdx/mise","slug":"brew-cask-kind-terminate-process-failure-mes-e065a6","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":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/artifacts.rs","lineNumber":816,"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":798,"sourceCodeEnd":834,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/artifacts.rs#L798-L834","documentation":"The optional `failure_message` of a `terminate_process` step must be a string (or absent/null). If it is any other type — number, boolean, array, object — the parser bails with this error. This message is shown to the user when the step fails to terminate the process.","triggerScenarios":"A cask sets `failure_message = 42`, `failure_message = true`, or an array/object in a terminate_process step; the `Some(_)` bail arm in parse_flight_step triggers.","commonSituations":"Accidentally assigning a variable holding a non-string value; quoting mistakes in TOML producing arrays; editing generated output where the field lost its string type.","solutions":["Change failure_message to a plain string: `failure_message = \"MyApp is still running; close it and retry\"`.","Remove the key entirely if no custom message is desired.","Convert the value to a string in the generator producing the cask file."],"exampleFix":"// before\n[[install.flight_steps]]\ntype = \"terminate_process\"\nname = \"MyApp\"\nfailure_message = true\n// after\n[[install.flight_steps]]\ntype = \"terminate_process\"\nname = \"MyApp\"\nfailure_message = \"MyApp is still running; close it and retry\"","handlingStrategy":"type-guard","validationCode":"function validateFailureMessage(step) {\n  if ('failure_message' in step && typeof step.failure_message !== 'string') {\n    throw new Error(`failure_message must be a string, got ${typeof step.failure_message}`);\n  }\n}","typeGuard":"const isValidFailureMessage = (m) => m === undefined || typeof m === 'string';","tryCatchPattern":null,"preventionTips":["Write user-facing messages as plain quoted strings in TOML.","Watch for generators that emit booleans/numbers into message fields.","Set failure_message null-free: either omit it or give a real string."],"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"}