Skip to main content

brush_interactive/
error.rs

1use std::path::PathBuf;
2
3/// Represents an error encountered while running or otherwise managing an interactive shell.
4#[derive(thiserror::Error, Debug)]
5pub enum ShellError {
6    /// An error occurred with the embedded shell.
7    #[error("{0}")]
8    ShellError(#[from] brush_core::Error),
9
10    /// A generic I/O error occurred.
11    #[error("I/O error: {0}")]
12    IoError(#[from] std::io::Error),
13
14    /// Failed to create xtrace file.
15    #[error("failed to create xtrace file '{0}': {1}")]
16    FailedToCreateXtraceFile(PathBuf, std::io::Error),
17
18    /// An error occurred while reading input.
19    #[error("input error occurred: {0}")]
20    InputError(std::io::Error),
21
22    /// The requested input backend type is not supported.
23    #[error("requested input backend type not supported")]
24    InputBackendNotSupported,
25
26    /// An unexpected error occurred while reading input.
27    #[error("unexpected error occurred reading input")]
28    UnexpectedInputFailure,
29}