can1357/oh-my-pi · error · SortError
{0}
Error message
{0} What it means
`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.
Source
Thrown at crates/pi-builtins/src/sort.rs:2590
Some(b'.') => b'.',
Some(b',') => b',',
_ => DECIMAL_PT,
}
}
const NEGATIVE: &u8 = &b'-';
const POSITIVE: &u8 = &b'+';
// The automatic buffer heuristics clamp to this range to avoid
// over-committing memory on constrained systems while still keeping
// reasonably large chunks for typical workloads.
const MIN_AUTOMATIC_BUF_SIZE: usize = 512 * 1024; // 512 KiB
const FALLBACK_AUTOMATIC_BUF_SIZE: usize = 32 * 1024 * 1024; // 32 MiB
const MAX_AUTOMATIC_BUF_SIZE: usize = 1024 * 1024 * 1024; // 1 GiB
#[derive(Debug, Error)]
pub enum SortError {
#[error("{0}")]
Message(String),
#[error("write failed: {}: {}", .path.maybe_quote(), strip_errno(.error))]
WriteFailed { path: OsString, error: std::io::Error },
#[error("{}", format_disorder(.file, .line_number, .line, .silent))]
Disorder { file: OsString, line_number: usize, line: String, silent: bool },
#[error("open failed: {}: {}", .path.maybe_quote(), strip_errno(.error))]
OpenFailed { path: PathBuf, error: std::io::Error },
#[error("cannot read: {}: {}", .path.maybe_quote(), strip_errno(.error))]
ReadFailed { path: PathBuf, error: std::io::Error },
#[error("failed to open temporary file: {}", strip_errno(.error))]
OpenTmpFileFailed { error: std::io::Error },
#[error("could not run compress program '{}': {}", .prog, strip_errno(.error))]View on GitHub (pinned to 9690622007)
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.
Defensive patterns
Strategy: try-catch
Try / catch
match sort_result {
Err(SortError::Message(msg)) => {
logger.error("sort failed with message", &msg);
// inspect msg and apply the specific remedy it describes
}
Err(e) => eprintln!("sort: {e}"),
Ok(_) => {}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Miscellaneous sort runtime failures surfaced during large-file or compress-program-assisted sorting where no specific variant applies.
Related errors
- unknown function: {0}
- unknown key binding function: {0}
- unimplemented: {0}
- I/O error occurred
- transparent (brush_parser::BindingParseError)
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/1a5f5c3d9224e766.
Report an issue: GitHub.