muster/domain/pty/error.rs
1use std::path::PathBuf;
2
3use thiserror::Error;
4
5/// Errors from spawning or interacting with a process under a PTY.
6#[derive(Debug, Error)]
7pub enum PtyError {
8 /// An I/O failure reading from or writing to the PTY.
9 #[error("pty i/o error: {0}")]
10 Io(#[from] std::io::Error),
11 /// The underlying PTY system reported a failure.
12 #[error("pty operation failed: {0}")]
13 System(String),
14 /// The configured working directory is missing or not a directory.
15 #[error("working directory is missing or not a directory: {0}")]
16 InvalidWorkingDir(PathBuf),
17 /// The requested operation is not supported here (e.g. process suspension
18 /// on a non-Unix platform, or a signal with no target pid).
19 #[error("operation not supported: {0}")]
20 Unsupported(String),
21}