pub enum CoreError {
Show 17 variants
Parse(ParseError),
Tokenization(String),
Analysis(String),
Plugin(String),
InvalidColor(String),
InvalidNumeric(String),
InvalidTime(String),
Utf8Error {
position: usize,
message: String,
},
Io(String),
OutOfMemory(String),
Config(String),
Validation(String),
FeatureNotSupported {
feature: String,
required_feature: String,
},
VersionIncompatible {
message: String,
},
ResourceLimitExceeded {
resource: String,
current: usize,
limit: usize,
},
SecurityViolation(String),
Internal(String),
}
Expand description
Main error type for ASS-RS core operations
Wraps all error types from different modules to provide a unified error handling interface. Can be converted from module-specific errors.
Variants§
Parse(ParseError)
Parsing errors from parser module
Tokenization(String)
Tokenization errors
Analysis(String)
Analysis errors
Plugin(String)
Plugin system errors
InvalidColor(String)
Color format parsing errors
InvalidNumeric(String)
Numeric value parsing errors
InvalidTime(String)
Time format parsing errors
Utf8Error
UTF-8 encoding errors
Io(String)
File I/O errors
OutOfMemory(String)
Memory allocation errors
Config(String)
Configuration errors
Validation(String)
Validation errors
FeatureNotSupported
Feature not supported in current configuration
VersionIncompatible
Version compatibility errors
ResourceLimitExceeded
Resource limit exceeded
SecurityViolation(String)
Security policy violation
Internal(String)
Internal consistency error (should not happen)
Implementations§
Source§impl CoreError
impl CoreError
Sourcepub const fn category(&self) -> ErrorCategory
pub const fn category(&self) -> ErrorCategory
Get error category for filtering/grouping
Returns the category that best describes the type of error, useful for organizing errors in user interfaces or logs.
Sourcepub const fn suggestion(&self) -> Option<&'static str>
pub const fn suggestion(&self) -> Option<&'static str>
Get suggested action for this error
Provides actionable advice for resolving common error scenarios.
Returns None
for errors that don’t have standard solutions.
Source§impl CoreError
impl CoreError
Sourcepub const fn is_recoverable(&self) -> bool
pub const fn is_recoverable(&self) -> bool
Check if error is recoverable
Sourcepub const fn is_internal_bug(&self) -> bool
pub const fn is_internal_bug(&self) -> bool
Check if error indicates a bug in the library
Sourcepub const fn as_parse_error(&self) -> Option<&ParseError>
pub const fn as_parse_error(&self) -> Option<&ParseError>
Get the underlying parse error if this is a parse error
Sourcepub const fn line_number(&self) -> Option<usize>
pub const fn line_number(&self) -> Option<usize>
Get line number for errors that have location information
Sourcepub fn is_parse_error_type(&self, error_type: &str) -> bool
pub fn is_parse_error_type(&self, error_type: &str) -> bool
Check if this is a specific type of parse error
Source§impl CoreError
impl CoreError
Sourcepub fn invalid_color<T: Display>(format: T) -> Self
pub fn invalid_color<T: Display>(format: T) -> Self
Create color error from invalid format
Sourcepub fn invalid_numeric<T: Display>(value: T, reason: &str) -> Self
pub fn invalid_numeric<T: Display>(value: T, reason: &str) -> Self
Create numeric error from parsing failure
Sourcepub fn invalid_time<T: Display>(time: T, reason: &str) -> Self
pub fn invalid_time<T: Display>(time: T, reason: &str) -> Self
Create time error from invalid format
Sourcepub const fn utf8_error(position: usize, message: String) -> Self
pub const fn utf8_error(position: usize, message: String) -> Self
Create UTF-8 error with position
Sourcepub fn feature_not_supported(feature: &str, required_feature: &str) -> Self
pub fn feature_not_supported(feature: &str, required_feature: &str) -> Self
Create feature not supported error
Sourcepub fn resource_limit_exceeded(
resource: &str,
current: usize,
limit: usize,
) -> Self
pub fn resource_limit_exceeded( resource: &str, current: usize, limit: usize, ) -> Self
Create resource limit error
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
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
Source§impl From<ParseError> for CoreError
Convert from parser errors
impl From<ParseError> for CoreError
Convert from parser errors
Source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Source§impl From<ParseFloatError> for CoreError
Convert from float parse errors
impl From<ParseFloatError> for CoreError
Convert from float parse errors
Source§fn from(err: ParseFloatError) -> Self
fn from(err: ParseFloatError) -> Self
Source§impl From<ParseIntError> for CoreError
Convert from integer parse errors
impl From<ParseIntError> for CoreError
Convert from integer parse errors