#[non_exhaustive]pub enum Error {
NoControllingTty,
EditorNotFound(String),
EditorNonZeroExit(i32),
InvalidEditorCommand(String),
TempFileDeleted(PathBuf),
InvalidBuilderConfiguration(&'static str),
CompatibilityViolation(&'static str),
Io(Error),
}Expand description
Errors returned by the rusty_vipe library API.
Marked #[non_exhaustive] so future variant additions are not breaking
changes within a major version.
§Examples
use rusty_vipe::Error;
// Errors implement Display via thiserror.
let e = Error::EditorNonZeroExit(42);
assert_eq!(e.to_string(), "editor exited with code 42");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoControllingTty
Opening the controlling terminal failed (/dev/tty on Unix or
CONIN$/CONOUT$ on Windows). Typical cause: process is running
without a controlling terminal (CI, cron, nohup-detached, headless
Docker RUN step).
EditorNotFound(String)
No editor could be resolved from the precedence ladder, OR the editor binary was not found at spawn time. Carries the editor command or env-var value that was attempted.
EditorNonZeroExit(i32)
The editor exited with a non-zero code. Per FR-006, this carries the already-clamped exit code (Unix 1–255 verbatim; Windows 1–254 verbatim, else clamped to 1). Library consumers can pattern-match on a known range.
InvalidEditorCommand(String)
shell-words parsing of an editor env value ($VISUAL/$EDITOR)
or --editor=<cmd> flag failed. Carries the original input.
TempFileDeleted(PathBuf)
The tempfile no longer exists after the editor returned. Typical
cause: user deleted it from within the editor (e.g., :!rm <file>).
InvalidBuilderConfiguration(&'static str)
The builder was configured into an impossible state.
CompatibilityViolation(&'static str)
A Default-mode-only setting was passed to Strict mode (or vice versa).
Io(Error)
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()