pub struct Error {
pub id: Uuid,
pub kind: ErrorKind,
pub message: String,
pub severity: ErrorSeverity,
pub source: String,
pub plugin_id: Option<String>,
pub correlation_id: Option<Uuid>,
pub timestamp: DateTime<Utc>,
pub metadata: Metadata,
pub backtrace: Option<String>,
pub causes: Vec<String>,
}
Fields§
§id: Uuid
§kind: ErrorKind
§message: String
§severity: ErrorSeverity
§source: String
§plugin_id: Option<String>
§correlation_id: Option<Uuid>
§timestamp: DateTime<Utc>
§metadata: Metadata
§backtrace: Option<String>
§causes: Vec<String>
Implementations§
Source§impl Error
impl Error
Sourcepub fn new(kind: ErrorKind, message: impl Into<String>) -> Self
pub fn new(kind: ErrorKind, message: impl Into<String>) -> Self
Creates a new error with the specified kind and message
Sourcepub fn severity(self, severity: ErrorSeverity) -> Self
pub fn severity(self, severity: ErrorSeverity) -> Self
Sets the error severity
Sourcepub fn correlation_id(self, correlation_id: Uuid) -> Self
pub fn correlation_id(self, correlation_id: Uuid) -> Self
Sets the correlation ID
Sourcepub fn with_metadata(self, metadata: Metadata) -> Self
pub fn with_metadata(self, metadata: Metadata) -> Self
Adds metadata collection to the error
Sourcepub fn should_handle(&self) -> bool
pub fn should_handle(&self) -> bool
Checks if the error should be handled automatically
Sourcepub fn is_critical(&self) -> bool
pub fn is_critical(&self) -> bool
Checks if the error is critical
Sourcepub fn manager(
manager_name: impl Into<String>,
operation: ManagerOperation,
message: impl Into<String>,
) -> Self
pub fn manager( manager_name: impl Into<String>, operation: ManagerOperation, message: impl Into<String>, ) -> Self
Creates a manager operation error
Sourcepub fn platform(
platform: impl Into<String>,
feature: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn platform( platform: impl Into<String>, feature: impl Into<String>, message: impl Into<String>, ) -> Self
Creates a platform-specific error
Sourcepub fn permission(
required_permission: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn permission( required_permission: impl Into<String>, message: impl Into<String>, ) -> Self
Creates a permission error
Sourcepub fn plugin(plugin_id: impl Into<String>, message: impl Into<String>) -> Self
pub fn plugin(plugin_id: impl Into<String>, message: impl Into<String>) -> Self
Creates a plugin error
Sourcepub fn authentication(message: impl Into<String>) -> Self
pub fn authentication(message: impl Into<String>) -> Self
Creates an authentication error
Creates an authorization error
Sourcepub fn file(
path: impl Into<String>,
operation: FileOperation,
message: impl Into<String>,
) -> Self
pub fn file( path: impl Into<String>, operation: FileOperation, message: impl Into<String>, ) -> Self
Creates a file operation error
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.