pub enum MTError {
ParseError {
line: usize,
column: usize,
message: String,
},
ValidationError {
field: String,
message: String,
},
UnsupportedMessageType {
message_type: String,
},
FieldNotFound {
field_tag: String,
},
InvalidFieldFormat {
field: String,
message: String,
},
MissingRequiredField {
field_tag: String,
},
InvalidMessageStructure {
message: String,
},
DateParseError {
message: String,
},
AmountParseError {
message: String,
},
CurrencyError {
message: String,
},
IoError(Error),
RegexError(Error),
}
Expand description
Main error type for SWIFT MT message parsing
Variants§
ParseError
ValidationError
UnsupportedMessageType
FieldNotFound
InvalidFieldFormat
MissingRequiredField
InvalidMessageStructure
DateParseError
AmountParseError
CurrencyError
IoError(Error)
RegexError(Error)
Implementations§
Source§impl MTError
impl MTError
Sourcepub fn parse_error(
line: usize,
column: usize,
message: impl Into<String>,
) -> Self
pub fn parse_error( line: usize, column: usize, message: impl Into<String>, ) -> Self
Create a new parse error
Sourcepub fn validation_error(
field: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn validation_error( field: impl Into<String>, message: impl Into<String>, ) -> Self
Create a new validation error
Sourcepub fn field_not_found(field_tag: impl Into<String>) -> Self
pub fn field_not_found(field_tag: impl Into<String>) -> Self
Create a new field not found error
Sourcepub fn invalid_field_format(
field: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn invalid_field_format( field: impl Into<String>, message: impl Into<String>, ) -> Self
Create a new invalid field format error
Sourcepub fn missing_required_field(field_tag: impl Into<String>) -> Self
pub fn missing_required_field(field_tag: impl Into<String>) -> Self
Create a new missing required field error
Trait Implementations§
Source§impl Error for MTError
impl Error for MTError
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()
Auto Trait Implementations§
impl Freeze for MTError
impl !RefUnwindSafe for MTError
impl Send for MTError
impl Sync for MTError
impl Unpin for MTError
impl !UnwindSafe for MTError
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