{"record":{"id":"213fb4915cd73200","repo":"sxyazi/yazi","slug":"invalid-file-mode-value-04o","errorCode":null,"errorMessage":"invalid file mode: {value:04o}","messagePattern":"invalid file mode: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"yazi-fs/src/cha/mode.rs","lineNumber":66,"sourceCode":"\tfn deref(&self) -> &Self::Target {\n\t\tmatch *self & Self::T_MASK {\n\t\t\tSelf::T_FILE => &ChaType::File,\n\t\t\tSelf::T_DIR => &ChaType::Dir,\n\t\t\tSelf::T_LINK => &ChaType::Link,\n\t\t\tSelf::T_BLOCK => &ChaType::Block,\n\t\t\tSelf::T_CHAR => &ChaType::Char,\n\t\t\tSelf::T_SOCK => &ChaType::Sock,\n\t\t\tSelf::T_FIFO => &ChaType::FIFO,\n\t\t\t_ => &ChaType::Unknown,\n\t\t}\n\t}\n}\n\nimpl TryFrom<u16> for ChaMode {\n\ttype Error = anyhow::Error;\n\n\tfn try_from(value: u16) -> Result<Self, Self::Error> {\n\t\tlet me = Self::from_bits(value).ok_or_else(|| anyhow!(\"invalid file mode: {value:04o}\"))?;\n\t\tmatch me & Self::T_MASK {\n\t\t\tSelf::T_FILE\n\t\t\t| Self::T_DIR\n\t\t\t| Self::T_LINK\n\t\t\t| Self::T_BLOCK\n\t\t\t| Self::T_CHAR\n\t\t\t| Self::T_SOCK\n\t\t\t| Self::T_FIFO => Ok(me),\n\t\t\t_ => bail!(\"invalid file type: {value:04o}\"),\n\t\t}\n\t}\n}\n\n#[cfg(unix)]\nimpl From<ChaMode> for std::fs::Permissions {\n\tfn from(value: ChaMode) -> Self {\n\t\tuse std::os::unix::fs::PermissionsExt;\n","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/sxyazi/yazi/blob/441b332de8b8800e70784cfbfb75369ab51ed9dd/yazi-fs/src/cha/mode.rs#L48-L84","documentation":"Error \"invalid file mode: {value:04o}\" thrown in sxyazi/yazi.","triggerScenarios":"Thrown at yazi-fs/src/cha/mode.rs:66 when the library encounters an invalid state.","commonSituations":"Parsing a mode value whose permission or type bits are not valid for a file mode.","solutions":["Provide a valid octal file mode (permission bits in range); fix the value passed to the mode parser."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"441b332de8b8800e70784cfbfb75369ab51ed9dd","analyzedAt":"2026-08-19T05:27:26.468Z","contentChangedAt":"2026-08-19T05:27:26.468Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}