#[non_exhaustive]pub enum FiscalError {
Show 15 variants
InvalidTaxData(String),
UnsupportedIcmsCst(String),
UnsupportedIcmsCsosn(String),
MissingRequiredField {
field: String,
},
InvalidGtin(String),
XmlGeneration(String),
XmlParsing(String),
SefazRejection {
code: String,
message: String,
},
Certificate(String),
InvalidStateCode(String),
Contingency(String),
InvalidTxt(String),
WrongDocument(String),
Network(String),
ConfigValidation(String),
}Expand description
The primary error type returned by all public functions in fiscal-core,
fiscal-crypto, and fiscal-sefaz.
All variants are #[non_exhaustive] so new error cases can be added in
future releases without breaking downstream match arms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidTaxData(String)
A tax data field contains an illegal value (e.g. malformed CNPJ, wrong field length, invalid access-key format).
UnsupportedIcmsCst(String)
An ICMS CST code is not recognised by the current tax computation module.
UnsupportedIcmsCsosn(String)
An ICMS CSOSN code is not recognised by the current tax computation module.
MissingRequiredField
A required XML field is absent. The field member names the missing tag.
InvalidGtin(String)
A GTIN barcode value is malformed or has an invalid check digit.
XmlGeneration(String)
An error occurred while building or serialising an XML document.
XmlParsing(String)
An error occurred while parsing an XML document.
SefazRejection
SEFAZ returned a rejection status code for a submitted document or event.
Fields
Certificate(String)
An error occurred while loading, parsing, or using a PKCS#12 certificate.
InvalidStateCode(String)
A two-letter state abbreviation (UF) or IBGE numeric code was not found in the lookup table.
Contingency(String)
An error occurred while activating, loading, or applying contingency mode.
InvalidTxt(String)
A TXT document is structurally invalid or references an unsupported layout.
WrongDocument(String)
The supplied document is not of the expected type (e.g. not a valid NFe TXT header).
Network(String)
An HTTP or network-level error occurred during SEFAZ communication.
ConfigValidation(String)
A configuration JSON is invalid or missing required fields.
Trait Implementations§
Source§impl Debug for FiscalError
impl Debug for FiscalError
Source§impl Display for FiscalError
impl Display for FiscalError
Source§impl Error for FiscalError
impl Error for FiscalError
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()