pub enum Error {
Show 26 variants
XmlParseError(DeError),
XmlSerializeError(SeError),
IoError(Error),
FileNotFound {
path: String,
},
DirectoryNotFound {
path: String,
},
FileReadError {
path: String,
reason: String,
},
FileWriteError {
path: String,
reason: String,
},
EntityNotFound {
entity: String,
available: Vec<String>,
},
CatalogEntryNotFound {
catalog: String,
entry: String,
},
CatalogNotFound {
catalog: String,
available: Vec<String>,
},
ValidationError {
field: String,
message: String,
},
MissingRequiredField {
field: String,
},
InvalidValue {
field: String,
value: String,
hint: String,
},
OutOfRange {
field: String,
value: String,
min: String,
max: String,
},
TypeMismatch {
field: String,
expected: String,
actual: String,
},
ParameterError {
param: String,
message: String,
},
ParameterNotFound {
param: String,
available: Vec<String>,
},
CircularDependency {
cycle: String,
},
InvalidXmlStructure {
message: String,
},
MalformedXml {
expected: String,
found: String,
location: String,
},
CatalogError(String),
ChoiceGroupError {
message: String,
},
ParseError {
input: String,
reason: String,
},
ExpressionError {
expression: String,
reason: String,
},
ConstraintViolation {
constraint: String,
},
InconsistentState {
message: String,
},
}Expand description
Main error type for the OpenSCENARIO library
Variants§
XmlParseError(DeError)
XML deserialization failures
XmlSerializeError(SeError)
XML serialization failures
IoError(Error)
File I/O failures
FileNotFound
File not found at specified path
DirectoryNotFound
Directory not found at specified path
FileReadError
Cannot read file
FileWriteError
Cannot write file
EntityNotFound
Entity reference not found
CatalogEntryNotFound
Catalog entry not found
CatalogNotFound
Catalog not found
ValidationError
Schema validation failures
MissingRequiredField
Missing required field
InvalidValue
Invalid value for field
OutOfRange
Value out of expected range
TypeMismatch
Type mismatch
ParameterError
Parameter resolution failures
ParameterNotFound
Parameter not found
CircularDependency
Circular dependency detected
InvalidXmlStructure
Invalid XML structure
MalformedXml
Malformed XML with location context
CatalogError(String)
Generic catalog system error
ChoiceGroupError
XSD Choice Group parsing errors
ParseError
Failed to parse input
ExpressionError
Expression evaluation failed
ConstraintViolation
Constraint violation
InconsistentState
Inconsistent state
Implementations§
Source§impl Error
impl Error
Sourcepub fn file_not_found(path: &str) -> Self
pub fn file_not_found(path: &str) -> Self
Create a file not found error
Sourcepub fn directory_not_found(path: &str) -> Self
pub fn directory_not_found(path: &str) -> Self
Create a directory not found error
Sourcepub fn file_read_error(path: &str, reason: &str) -> Self
pub fn file_read_error(path: &str, reason: &str) -> Self
Create a file read error
Sourcepub fn file_write_error(path: &str, reason: &str) -> Self
pub fn file_write_error(path: &str, reason: &str) -> Self
Create a file write error
Sourcepub fn entity_not_found(entity: &str, available: &[String]) -> Self
pub fn entity_not_found(entity: &str, available: &[String]) -> Self
Create an entity not found error
Sourcepub fn catalog_entry_not_found(catalog: &str, entry: &str) -> Self
pub fn catalog_entry_not_found(catalog: &str, entry: &str) -> Self
Create a catalog entry not found error
Sourcepub fn catalog_not_found(catalog: &str, available: &[String]) -> Self
pub fn catalog_not_found(catalog: &str, available: &[String]) -> Self
Create a catalog not found error
Sourcepub fn validation_error(field: &str, message: &str) -> Self
pub fn validation_error(field: &str, message: &str) -> Self
Create a validation error
Sourcepub fn missing_field(field: &str) -> Self
pub fn missing_field(field: &str) -> Self
Create a missing required field error
Sourcepub fn invalid_value(field: &str, value: &str, hint: &str) -> Self
pub fn invalid_value(field: &str, value: &str, hint: &str) -> Self
Create an invalid value error
Sourcepub fn out_of_range(field: &str, value: &str, min: &str, max: &str) -> Self
pub fn out_of_range(field: &str, value: &str, min: &str, max: &str) -> Self
Create an out of range error
Sourcepub fn type_mismatch(field: &str, expected: &str, actual: &str) -> Self
pub fn type_mismatch(field: &str, expected: &str, actual: &str) -> Self
Create a type mismatch error
Sourcepub fn parameter_error(param: &str, message: &str) -> Self
pub fn parameter_error(param: &str, message: &str) -> Self
Create a parameter error
Sourcepub fn parameter_not_found(param: &str, available: &[String]) -> Self
pub fn parameter_not_found(param: &str, available: &[String]) -> Self
Create a parameter not found error
Sourcepub fn invalid_xml(message: &str) -> Self
pub fn invalid_xml(message: &str) -> Self
Create an invalid XML structure error
Sourcepub fn malformed_xml(expected: &str, found: &str, location: &str) -> Self
pub fn malformed_xml(expected: &str, found: &str, location: &str) -> Self
Create a malformed XML error with location
Sourcepub fn parsing_error(msg: &str, line: usize, col: usize) -> Self
pub fn parsing_error(msg: &str, line: usize, col: usize) -> Self
Create a parsing error with location information
Sourcepub fn circular_dependency(cycle: &str) -> Self
pub fn circular_dependency(cycle: &str) -> Self
Create a circular dependency error
Sourcepub fn parse_error(input: &str, reason: &str) -> Self
pub fn parse_error(input: &str, reason: &str) -> Self
Create a parse error
Sourcepub fn expression_error(expression: &str, reason: &str) -> Self
pub fn expression_error(expression: &str, reason: &str) -> Self
Create an expression error
Sourcepub fn constraint_violation(constraint: &str) -> Self
pub fn constraint_violation(constraint: &str) -> Self
Create a constraint violation error
Sourcepub fn catalog_error(message: &str) -> Self
pub fn catalog_error(message: &str) -> Self
Create a catalog error
Sourcepub fn choice_group_error(message: &str) -> Self
pub fn choice_group_error(message: &str) -> Self
Create a choice group error
Sourcepub fn with_context(self, context: &str) -> Self
pub fn with_context(self, context: &str) -> Self
Add context to an error
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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
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>
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>
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