pub enum FerrumError {
Show 22 variants
Config {
message: String,
},
Model {
message: String,
},
Tokenizer {
message: String,
},
Backend {
message: String,
},
Device {
message: String,
},
Scheduler {
message: String,
},
RequestValidation {
message: String,
},
ResourceExhausted {
message: String,
},
Timeout {
message: String,
},
Auth {
message: String,
},
RateLimit {
message: String,
},
IO {
message: String,
},
Serialization {
message: String,
},
Network {
message: String,
},
Internal {
message: String,
},
Cancelled {
message: String,
},
NotFound {
message: String,
},
AlreadyExists {
message: String,
},
PermissionDenied {
message: String,
},
Unsupported {
message: String,
},
InvalidFormat {
message: String,
},
InvalidParameter {
message: String,
},
}Expand description
Main error type for Ferrum operations
Variants§
Config
Configuration errors
Model
Model loading/initialization errors
Tokenizer
Tokenizer errors
Backend
Backend/runtime errors
Device
Device/memory errors
Scheduler
Scheduling/queue errors
RequestValidation
Request validation errors
ResourceExhausted
Resource exhaustion errors
Timeout
Timeout errors
Auth
Authentication/authorization errors
RateLimit
Rate limiting errors
IO
I/O errors
Serialization
Serialization/deserialization errors
Network
Network errors
Internal
Internal errors (should not happen in normal operation)
Cancelled
Request was cancelled
NotFound
Not found errors
AlreadyExists
Already exists errors
PermissionDenied
Permission denied errors
Unsupported
Unsupported operation errors
InvalidFormat
Invalid format errors (parsing, schema mismatches)
InvalidParameter
Invalid parameters or configuration values
Implementations§
Source§impl FerrumError
impl FerrumError
Sourcepub fn config(message: impl Into<String>) -> FerrumError
pub fn config(message: impl Into<String>) -> FerrumError
Create a configuration error
Sourcepub fn model(message: impl Into<String>) -> FerrumError
pub fn model(message: impl Into<String>) -> FerrumError
Create a model error
Sourcepub fn tokenizer(message: impl Into<String>) -> FerrumError
pub fn tokenizer(message: impl Into<String>) -> FerrumError
Create a tokenizer error
Sourcepub fn backend(message: impl Into<String>) -> FerrumError
pub fn backend(message: impl Into<String>) -> FerrumError
Create a backend error
Sourcepub fn device(message: impl Into<String>) -> FerrumError
pub fn device(message: impl Into<String>) -> FerrumError
Create a device error
Sourcepub fn scheduler(message: impl Into<String>) -> FerrumError
pub fn scheduler(message: impl Into<String>) -> FerrumError
Create a scheduler error
Sourcepub fn request_validation(message: impl Into<String>) -> FerrumError
pub fn request_validation(message: impl Into<String>) -> FerrumError
Create a request validation error
Sourcepub fn resource_exhausted(message: impl Into<String>) -> FerrumError
pub fn resource_exhausted(message: impl Into<String>) -> FerrumError
Create a resource exhausted error
Sourcepub fn timeout(message: impl Into<String>) -> FerrumError
pub fn timeout(message: impl Into<String>) -> FerrumError
Create a timeout error
Sourcepub fn auth(message: impl Into<String>) -> FerrumError
pub fn auth(message: impl Into<String>) -> FerrumError
Create an auth error
Sourcepub fn rate_limit(message: impl Into<String>) -> FerrumError
pub fn rate_limit(message: impl Into<String>) -> FerrumError
Create a rate limit error
Sourcepub fn io(message: impl Into<String>) -> FerrumError
pub fn io(message: impl Into<String>) -> FerrumError
Create an I/O error
Sourcepub fn serialization(message: impl Into<String>) -> FerrumError
pub fn serialization(message: impl Into<String>) -> FerrumError
Create a serialization error
Sourcepub fn network(message: impl Into<String>) -> FerrumError
pub fn network(message: impl Into<String>) -> FerrumError
Create a network error
Sourcepub fn internal(message: impl Into<String>) -> FerrumError
pub fn internal(message: impl Into<String>) -> FerrumError
Create an internal error
Sourcepub fn cancelled(message: impl Into<String>) -> FerrumError
pub fn cancelled(message: impl Into<String>) -> FerrumError
Create a cancelled error
Sourcepub fn not_found(message: impl Into<String>) -> FerrumError
pub fn not_found(message: impl Into<String>) -> FerrumError
Create a not found error
Sourcepub fn already_exists(message: impl Into<String>) -> FerrumError
pub fn already_exists(message: impl Into<String>) -> FerrumError
Create an already exists error
Sourcepub fn permission_denied(message: impl Into<String>) -> FerrumError
pub fn permission_denied(message: impl Into<String>) -> FerrumError
Create a permission denied error
Sourcepub fn unsupported(message: impl Into<String>) -> FerrumError
pub fn unsupported(message: impl Into<String>) -> FerrumError
Create an unsupported operation error
Sourcepub fn invalid_format(message: impl Into<String>) -> FerrumError
pub fn invalid_format(message: impl Into<String>) -> FerrumError
Create an invalid format error (parsing/schema mismatch)
Sourcepub fn invalid_parameter(message: impl Into<String>) -> FerrumError
pub fn invalid_parameter(message: impl Into<String>) -> FerrumError
Create an invalid parameter error
Sourcepub fn io_str(message: impl Into<String>) -> FerrumError
pub fn io_str(message: impl Into<String>) -> FerrumError
Alias for io() - Create an I/O error from string
Sourcepub fn configuration(message: impl Into<String>) -> FerrumError
pub fn configuration(message: impl Into<String>) -> FerrumError
Alias for config() - Create a configuration error
Sourcepub fn deserialization(message: impl Into<String>) -> FerrumError
pub fn deserialization(message: impl Into<String>) -> FerrumError
Alias for serialization() - Create a deserialization error
Sourcepub fn invalid_request(message: impl Into<String>) -> FerrumError
pub fn invalid_request(message: impl Into<String>) -> FerrumError
Alias for request_validation() - Create an invalid request error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this is a retryable error
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Check if this is a client error (4xx equivalent)
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Check if this is a server error (5xx equivalent)
Trait Implementations§
Source§impl Clone for FerrumError
impl Clone for FerrumError
Source§fn clone(&self) -> FerrumError
fn clone(&self) -> FerrumError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FerrumError
impl Debug for FerrumError
Source§impl<'de> Deserialize<'de> for FerrumError
impl<'de> Deserialize<'de> for FerrumError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FerrumError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FerrumError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for FerrumError
impl Display for FerrumError
Source§impl Error for FerrumError
impl Error for FerrumError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for FerrumError
Conversion from std::io::Error
impl From<Error> for FerrumError
Conversion from std::io::Error
Source§fn from(err: Error) -> FerrumError
fn from(err: Error) -> FerrumError
Source§impl From<Error> for FerrumError
Conversion from serde_json::Error
impl From<Error> for FerrumError
Conversion from serde_json::Error