pub enum PiError {
Io(Error),
Json(Error),
SessionNotFound(String),
ProjectNotFound(String),
InvalidSessionFile {
path: PathBuf,
reason: String,
},
MalformedHeader(String),
Convo(ConvoError),
Anyhow(Error),
Other(String),
}Expand description
Errors produced by the toolpath-pi crate.
Variants§
Io(Error)
Underlying I/O failure.
Json(Error)
JSON (de)serialization failure.
SessionNotFound(String)
A session file was expected but could not be located.
ProjectNotFound(String)
A project directory (encoded cwd) was expected but not found on disk.
InvalidSessionFile
A session JSONL file exists but cannot be interpreted.
Carries the offending path and a short human-readable reason.
MalformedHeader(String)
A session header line was present but malformed (missing required fields, unexpected shape, etc.).
Convo(ConvoError)
Wrapped error from toolpath-convo.
Anyhow(Error)
Catch-all for arbitrary anyhow errors bubbling up from dependencies.
Other(String)
Generic free-form error.
Implementations§
Source§impl PiError
impl PiError
Sourcepub fn session_not_found(id: impl Into<String>) -> Self
pub fn session_not_found(id: impl Into<String>) -> Self
Construct a SessionNotFound error.
Sourcepub fn project_not_found(cwd: impl Into<String>) -> Self
pub fn project_not_found(cwd: impl Into<String>) -> Self
Construct a ProjectNotFound error.
Sourcepub fn invalid_session_file(
path: impl Into<PathBuf>,
reason: impl Into<String>,
) -> Self
pub fn invalid_session_file( path: impl Into<PathBuf>, reason: impl Into<String>, ) -> Self
Construct an InvalidSessionFile error.
Sourcepub fn malformed_header(reason: impl Into<String>) -> Self
pub fn malformed_header(reason: impl Into<String>) -> Self
Construct a MalformedHeader error.
Trait Implementations§
Source§impl Error for PiError
impl Error for PiError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ConvoError> for PiError
impl From<ConvoError> for PiError
Source§fn from(source: ConvoError) -> Self
fn from(source: ConvoError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PiError
impl !RefUnwindSafe for PiError
impl Send for PiError
impl Sync for PiError
impl Unpin for PiError
impl UnsafeUnpin for PiError
impl !UnwindSafe for PiError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more