pub enum AppError {
Show 15 variants
Database(String),
NotFound(String),
Validation(String),
Configuration(String),
Io(Error),
Serialization(String),
Network(String),
Authentication(String),
Authorization(String),
RateLimit,
Timeout(String),
Internal(String),
Integration {
integration_source: String,
message: String,
},
Processing(String),
InvalidStateTransition(String),
}Expand description
Application error types
Variants§
Database(String)
Database errors
NotFound(String)
Not found errors
Validation(String)
Validation errors
Configuration(String)
Configuration errors
Io(Error)
IO errors
Serialization(String)
Serialization errors
Network(String)
Network errors
Authentication(String)
Authentication errors
Authorization(String)
Authorization errors
RateLimit
Rate limit errors
Timeout(String)
Timeout errors
Internal(String)
Internal server errors
Integration
Integration errors
Processing(String)
Processing errors
InvalidStateTransition(String)
Invalid state transition
Implementations§
Source§impl AppError
impl AppError
Sourcepub fn status_code(&self) -> StatusCode
pub fn status_code(&self) -> StatusCode
Get HTTP status code for this error
Sourcepub fn error_code(&self) -> &str
pub fn error_code(&self) -> &str
Get error code string
Trait Implementations§
Source§impl Error for AppError
impl Error for AppError
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<AnalyticsError> for AppError
impl From<AnalyticsError> for AppError
Source§fn from(err: AnalyticsError) -> Self
fn from(err: AnalyticsError) -> Self
Converts to this type from the input type.
Source§impl From<CircuitBreakerError> for AppError
impl From<CircuitBreakerError> for AppError
Source§fn from(err: CircuitBreakerError) -> Self
fn from(err: CircuitBreakerError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigError> for AppError
Conversion from config::ConfigError
impl From<ConfigError> for AppError
Conversion from config::ConfigError
Source§fn from(err: ConfigError) -> Self
fn from(err: ConfigError) -> Self
Converts to this type from the input type.
Source§impl From<IntegrationError> for AppError
Convert IntegrationError to AppError
impl From<IntegrationError> for AppError
Convert IntegrationError to AppError
Source§fn from(err: IntegrationError) -> Self
fn from(err: IntegrationError) -> Self
Converts to this type from the input type.
Source§impl From<MessagingError> for AppError
impl From<MessagingError> for AppError
Source§fn from(err: MessagingError) -> Self
fn from(err: MessagingError) -> Self
Converts to this type from the input type.
Source§impl From<SchedulerError> for AppError
impl From<SchedulerError> for AppError
Source§fn from(err: SchedulerError) -> Self
fn from(err: SchedulerError) -> Self
Converts to this type from the input type.
Source§impl From<SearchError> for AppError
impl From<SearchError> for AppError
Source§fn from(err: SearchError) -> Self
fn from(err: SearchError) -> Self
Converts to this type from the input type.
Source§impl From<ValidationErrors> for AppError
Conversion from validator::ValidationErrors
impl From<ValidationErrors> for AppError
Conversion from validator::ValidationErrors
Source§fn from(err: ValidationErrors) -> Self
fn from(err: ValidationErrors) -> Self
Converts to this type from the input type.
Source§impl IntoResponse for AppError
Convert AppError to HTTP response
impl IntoResponse for AppError
Convert AppError to HTTP response
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl Freeze for AppError
impl !RefUnwindSafe for AppError
impl Send for AppError
impl Sync for AppError
impl Unpin for AppError
impl !UnwindSafe for AppError
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ValidateIp for Twhere
T: ToString,
impl<T> ValidateIp for Twhere
T: ToString,
Source§fn validate_ipv4(&self) -> bool
fn validate_ipv4(&self) -> bool
Validates whether the given string is an IP V4
Source§fn validate_ipv6(&self) -> bool
fn validate_ipv6(&self) -> bool
Validates whether the given string is an IP V6
Source§fn validate_ip(&self) -> bool
fn validate_ip(&self) -> bool
Validates whether the given string is an IP