pub enum CoreError {
Show 20 variants
Io(Error),
Yaml(Error),
Json(Error),
Validation {
message: String,
},
Configuration {
message: String,
},
ServiceNotFound {
service_type: String,
},
InvalidServiceScope {
scope: String,
},
LockError {
resource: String,
},
LifecycleError {
component: String,
operation: String,
source: Box<dyn Error + Sync + Send>,
},
SystemError {
message: String,
source: Option<Box<dyn Error + Sync + Send>>,
},
Module {
message: String,
},
Provider {
message: String,
},
Codegen {
message: String,
},
Template {
message: String,
},
Database {
message: String,
},
CircularDependency {
path: String,
cycle_service: String,
},
InvalidServiceDescriptor {
message: String,
},
DependencyResolutionFailed {
service_type: String,
message: String,
},
Api {
code: String,
message: String,
hint: Option<String>,
},
ServiceInitializationFailed {
service_type: String,
source: Box<dyn Error + Sync + Send>,
},
}
Expand description
Core error type for the elif framework
Variants§
Io(Error)
Yaml(Error)
Json(Error)
Validation
Configuration
ServiceNotFound
InvalidServiceScope
LockError
LifecycleError
SystemError
Module
Provider
Codegen
Template
Database
CircularDependency
InvalidServiceDescriptor
DependencyResolutionFailed
Api
ServiceInitializationFailed
Implementations§
Source§impl CoreError
impl CoreError
Sourcepub fn validation(message: impl Into<String>) -> CoreError
pub fn validation(message: impl Into<String>) -> CoreError
Create a new validation error
Sourcepub fn configuration(message: impl Into<String>) -> CoreError
pub fn configuration(message: impl Into<String>) -> CoreError
Create a new configuration error
Sourcepub fn service_not_found(service_type: impl Into<String>) -> CoreError
pub fn service_not_found(service_type: impl Into<String>) -> CoreError
Create a new service not found error
Sourcepub fn system_error(message: impl Into<String>) -> CoreError
pub fn system_error(message: impl Into<String>) -> CoreError
Create a new system error
Sourcepub fn system_error_with_source(
message: impl Into<String>,
source: Box<dyn Error + Sync + Send>,
) -> CoreError
pub fn system_error_with_source( message: impl Into<String>, source: Box<dyn Error + Sync + Send>, ) -> CoreError
Create a new system error with source
Sourcepub fn api_error(
code: impl Into<String>,
message: impl Into<String>,
) -> CoreError
pub fn api_error( code: impl Into<String>, message: impl Into<String>, ) -> CoreError
Create a new API error
Sourcepub fn is_validation(&self) -> bool
pub fn is_validation(&self) -> bool
Check if the error is a validation error
Sourcepub fn is_configuration(&self) -> bool
pub fn is_configuration(&self) -> bool
Check if the error is a configuration error
Sourcepub fn is_service(&self) -> bool
pub fn is_service(&self) -> bool
Check if the error is a service error
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
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<ModuleRuntimeError> for CoreError
Convert ModuleRuntimeError to CoreError for compatibility
impl From<ModuleRuntimeError> for CoreError
Convert ModuleRuntimeError to CoreError for compatibility
Source§fn from(err: ModuleRuntimeError) -> CoreError
fn from(err: ModuleRuntimeError) -> CoreError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CoreError
impl !RefUnwindSafe for CoreError
impl Send for CoreError
impl Sync for CoreError
impl Unpin for CoreError
impl !UnwindSafe for CoreError
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> 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 more