pub struct DataError {
pub code: i32,
pub msg: String,
pub data: Option<Value>,
pub source: Option<Box<dyn Error + Send + Sync>>,
}Fields§
§code: i32§msg: String§data: Option<Value>§source: Option<Box<dyn Error + Send + Sync>>Implementations§
Source§impl DataError
impl DataError
pub fn bad_request(msg: impl Into<String>) -> Self
pub fn not_found(msg: impl Into<String>) -> Self
pub fn conflicted(msg: impl Into<String>) -> Self
pub fn forbidden(msg: impl Into<String>) -> Self
pub fn server_error(msg: impl Into<String>) -> Self
pub fn biz_error(code: i32, msg: impl Into<String>, data: Option<Value>) -> Self
pub fn internal( code: i32, msg: impl Into<String>, source: Option<Box<dyn Error + Send + Sync>>, ) -> Self
pub fn retry_limit(msg: impl Into<String>, retry_limit: u32) -> Self
Trait Implementations§
Source§impl Error for DataError
impl Error for DataError
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<AddrParseError> for DataError
impl From<AddrParseError> for DataError
Source§fn from(value: AddrParseError) -> Self
fn from(value: AddrParseError) -> Self
Converts to this type from the input type.
Source§impl From<ComponentError> for DataError
impl From<ComponentError> for DataError
Source§fn from(value: ComponentError) -> Self
fn from(value: ComponentError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigError> for DataError
impl From<ConfigError> for DataError
Source§fn from(value: ConfigError) -> Self
fn from(value: ConfigError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigureError> for DataError
impl From<ConfigureError> for DataError
Source§fn from(value: ConfigureError) -> Self
fn from(value: ConfigureError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for DataError
impl From<Error> for DataError
Source§fn from(value: SecurityError) -> Self
fn from(value: SecurityError) -> Self
Converts to this type from the input type.
Source§impl From<SystemTimeError> for DataError
impl From<SystemTimeError> for DataError
Source§fn from(value: SystemTimeError) -> Self
fn from(value: SystemTimeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DataError
impl !RefUnwindSafe for DataError
impl Send for DataError
impl Sync for DataError
impl Unpin for DataError
impl !UnwindSafe for DataError
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