pub enum Error {
Show 13 variants
Ucm {
code: ErrorCode,
message: String,
location: Option<Location>,
context: Option<String>,
suggestion: Option<String>,
},
BlockNotFound(String),
InvalidBlockId(String),
InvalidDocumentId(String),
CycleDetected(String),
VersionConflict {
expected: u64,
actual: u64,
},
Validation(String),
Parse {
message: String,
line: usize,
column: usize,
},
ResourceLimit(String),
Security(String),
Serialization(Error),
Io(Error),
Internal(String),
}Expand description
Main error type for UCM operations
Variants§
Ucm
Fields
BlockNotFound(String)
InvalidBlockId(String)
InvalidDocumentId(String)
CycleDetected(String)
VersionConflict
Validation(String)
Parse
ResourceLimit(String)
Security(String)
Serialization(Error)
Io(Error)
Internal(String)
Implementations§
Source§impl Error
impl Error
Sourcepub fn new(code: ErrorCode, message: impl Into<String>) -> Self
pub fn new(code: ErrorCode, message: impl Into<String>) -> Self
Create a new UCM error with full details
Sourcepub fn with_location(self, location: Location) -> Self
pub fn with_location(self, location: Location) -> Self
Add location information
Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Add context (e.g., the problematic command)
Sourcepub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
Add a suggestion for fixing the 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)>
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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