{"record":{"id":"170657679e6c0713","repo":"jdx/mise","slug":"path-raw-id-unknown-line-position-other","errorCode":null,"errorMessage":"\"{path_raw}\".{id}: unknown line position '{other}' (expected \"append\" or \"prepend\"), ignoring entry","messagePattern":"\"(.+?)\"\\.(.+?): unknown line position '(.+?)' \\(expected \"append\" or \"prepend\"\\), ignoring entry","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/edits.rs","lineNumber":360,"sourceCode":"                source,\n                template,\n                comment,\n            }\n        }\n        (false, Some(line)) => {\n            // a \"line\" is matched against the file's individual lines, so an\n            // embedded newline could never converge — use a block for\n            // multi-line content\n            if line.contains('\\n') {\n                bail!(\n                    \"\\\"{path_raw}\\\".{id}: line may not contain a newline; use a block for multi-line content, ignoring entry\"\n                )\n            }\n            let position = match entry.position.as_deref() {\n                None | Some(\"append\") => LinePosition::Append,\n                Some(\"prepend\") => LinePosition::Prepend,\n                Some(other) => {\n                    bail!(\n                        \"\\\"{path_raw}\\\".{id}: unknown line position '{other}' (expected \\\"append\\\" or \\\"prepend\\\"), ignoring entry\"\n                    )\n                }\n            };\n            EditOp::Line {\n                line: line.clone(),\n                position,\n            }\n        }\n    };\n    Ok(EditRequest {\n        path_raw: path_raw.to_string(),\n        path,\n        id,\n        op,\n        base: base.to_path_buf(),\n        config_path: config_path.to_path_buf(),\n        origin,","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/edits.rs#L342-L378","documentation":"For line-based edits, the `position` field accepts only \"append\" or \"prepend\" (omitting it defaults to append). Any other value makes `resolve_entry` bail and ignore the entry, because there is no other defined placement for a managed line.","triggerScenarios":"A line edit entry sets `position = \"end\"`, `position = \"top\"`, `position = \"after\"`, or any misspelling. `resolve_entry` matches `Some(other)` in the position match and bails at src/system/edits.rs:360.","commonSituations":"Users guess position names from other tools, misspell \"append\"/\"prepend\", or copy `position` semantics from an unrelated configuration format.","solutions":["Use `position = \"append\"` to add the line at the end of the file.","Use `position = \"prepend\"` to add the line at the top of the file.","Remove `position` entirely to get the default (append) behavior.","Re-run the edits command and confirm the entry is applied."],"exampleFix":"# before\n[dotfiles.\"~/.zshrc\".path-entry]\nline = \"export PATH=$HOME/bin:$PATH\"\nposition = \"top\"\n\n# after\n[dotfiles.\"~/.zshrc\".path-entry]\nline = \"export PATH=$HOME/bin:$PATH\"\nposition = \"prepend\"","handlingStrategy":"validation","validationCode":"if let Some(p) = &e.position {\n    if !matches!(p.as_str(), \"append\" | \"prepend\") {\n        return Err(format!(\"position must be \\\"append\\\" or \\\"prepend\\\", got {p}\"));\n    }\n}","typeGuard":"fn is_valid_position(p: &Option<String>) -> bool {\n    p.as_deref().map_or(true, |v| matches!(v, \"append\" | \"prepend\"))\n}","tryCatchPattern":null,"preventionTips":["Memorize the two valid values: append (default) and prepend.","Omit `position` when append behavior is fine.","Do not carry position vocabulary over from other tools' configs."],"tags":["config","validation","dotfiles"],"backgroundTag":"invalid-enum-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}