pub enum GritError {
InvalidArgs(String),
NotFound(String),
Conflict(String),
DbBusy(String),
Io(Error),
Sled(Error),
Json(Error),
TomlParse(Error),
TomlSerialize(Error),
IdParse(IdParseError),
Internal(String),
Ipc(String),
}Expand description
Main error type for grit operations
Variants§
InvalidArgs(String)
NotFound(String)
Conflict(String)
DbBusy(String)
Io(Error)
Sled(Error)
Json(Error)
TomlParse(Error)
TomlSerialize(Error)
IdParse(IdParseError)
Internal(String)
Ipc(String)
Implementations§
Source§impl GritError
impl GritError
Sourcepub fn error_code(&self) -> &'static str
pub fn error_code(&self) -> &'static str
Get the error code for JSON output (from cli-json.md)
Sourcepub fn suggestions(&self) -> Vec<&'static str>
pub fn suggestions(&self) -> Vec<&'static str>
Get actionable suggestions for fixing the error
Sourcepub fn issue_not_found(issue_id: &str) -> Self
pub fn issue_not_found(issue_id: &str) -> Self
Create a NotFound error for an issue with helpful context
Sourcepub fn database_locked(details: Option<&str>) -> Self
pub fn database_locked(details: Option<&str>) -> Self
Create a DbBusy error with process info
Trait Implementations§
Source§impl Error for GritError
impl Error for GritError
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<IdParseError> for GritError
impl From<IdParseError> for GritError
Source§fn from(source: IdParseError) -> Self
fn from(source: IdParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for GritError
impl !UnwindSafe for GritError
impl Freeze for GritError
impl Send for GritError
impl Sync for GritError
impl Unpin for GritError
impl UnsafeUnpin for GritError
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