{"record":{"id":"1a5f5c3d9224e766","repo":"can1357/oh-my-pi","slug":"0-1a5f5c","errorCode":null,"errorMessage":"{0}","messagePattern":"\\{0\\}","errorType":"exception","errorClass":"SortError","httpStatus":null,"severity":"error","filePath":"crates/pi-builtins/src/sort.rs","lineNumber":2590,"sourceCode":"\t\tSome(b'.') => b'.',\n\t\tSome(b',') => b',',\n\t\t_ => DECIMAL_PT,\n\t}\n}\n\nconst NEGATIVE: &u8 = &b'-';\nconst POSITIVE: &u8 = &b'+';\n\n// The automatic buffer heuristics clamp to this range to avoid\n// over-committing memory on constrained systems while still keeping\n// reasonably large chunks for typical workloads.\nconst MIN_AUTOMATIC_BUF_SIZE: usize = 512 * 1024; // 512 KiB\nconst FALLBACK_AUTOMATIC_BUF_SIZE: usize = 32 * 1024 * 1024; // 32 MiB\nconst MAX_AUTOMATIC_BUF_SIZE: usize = 1024 * 1024 * 1024; // 1 GiB\n\n#[derive(Debug, Error)]\npub enum SortError {\n\t#[error(\"{0}\")]\n\tMessage(String),\n\n\t#[error(\"write failed: {}: {}\", .path.maybe_quote(), strip_errno(.error))]\n\tWriteFailed { path: OsString, error: std::io::Error },\n\n\t#[error(\"{}\", format_disorder(.file, .line_number, .line, .silent))]\n\tDisorder { file: OsString, line_number: usize, line: String, silent: bool },\n\n\t#[error(\"open failed: {}: {}\", .path.maybe_quote(), strip_errno(.error))]\n\tOpenFailed { path: PathBuf, error: std::io::Error },\n\n\t#[error(\"cannot read: {}: {}\", .path.maybe_quote(), strip_errno(.error))]\n\tReadFailed { path: PathBuf, error: std::io::Error },\n\n\t#[error(\"failed to open temporary file: {}\", strip_errno(.error))]\n\tOpenTmpFileFailed { error: std::io::Error },\n\n\t#[error(\"could not run compress program '{}': {}\", .prog, strip_errno(.error))]","sourceCodeStart":2572,"sourceCodeEnd":2608,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/crates/pi-builtins/src/sort.rs#L2572-L2608","documentation":"`SortError::Message(String)` is a generic catch-all error in the sort builtin's error enum, rendered verbatim via `{0}`. It carries an arbitrary pre-formatted message produced by internal sort routines. Inspect the embedded string — it is the entire diagnostic.","triggerScenarios":"Any internal sort code path that reports a failure not covered by a dedicated variant (WriteFailed, Disorder, OpenFailed, etc.), constructed by wrapping a plain String into SortError.","commonSituations":"Miscellaneous sort runtime failures surfaced during large-file or compress-program-assisted sorting where no specific variant applies.","solutions":["Read the embedded message text; it is the complete diagnostic.","Match the message content against dedicated SortError variants to see if a more specific fix applies.","If the message points to a flag or input problem, correct that argument or input and rerun."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match sort_result {\n    Err(SortError::Message(msg)) => {\n        logger.error(\"sort failed with message\", &msg);\n        // inspect msg and apply the specific remedy it describes\n    }\n    Err(e) => eprintln!(\"sort: {e}\"),\n    Ok(_) => {}\n}","preventionTips":["Log the full embedded message; it is the only diagnostic.","Prefer explicit inputs/flags to avoid falling into unspecified failure paths.","Re-run with the same arguments when reporting the issue upstream."],"tags":["sort","builtin","generic-error"],"backgroundTag":"generic-builtin-error","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}