#[non_exhaustive]pub enum Error {
Parse(EdifactError),
Serialize(String),
MissingSegment(&'static str),
UnknownDocumentCode {
raw_code: String,
},
CarrierMismatch {
document: &'static str,
expected: &'static str,
raw_code: String,
},
Io(Error),
}Expand description
Errors produced by dvgw-edi.
All public API entry points return Result<_, Error>.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Parse(EdifactError)
The underlying EDIFACT tokeniser rejected the input.
Serialize(String)
Rendering an outbound message back to EDIFACT bytes failed.
MissingSegment(&'static str)
A segment the DVGW Nachrichtenbeschreibung marks Muss is absent, so the
message cannot even be identified.
UnknownDocumentCode
BGM C002 DE 1001 does not carry a document-name code this crate knows.
DVGW identifies the logical message (ALOCAT / NOMINT / NOMRES) by this
code — not by the UNH message type, which is always the UN/EDIFACT
carrier ORDERS or ORDRSP.
The raw code is kept out of Display so an untrusted value cannot reach
operator logs; read it from raw_code when diagnosing.
CarrierMismatch
UNH S009 DE 0065 names a carrier that does not match the document code.
NOMINT rides ORDERS; ALOCAT and NOMRES ride ORDRSP. A mismatch means
the two identifying fields disagree, which no conformant sender produces.
Fields
Io(Error)
A wrapped I/O error from the reader-based entry points.
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()