#[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()
Source§impl PartialEq for FiscalError
impl PartialEq for FiscalError
impl Eq for FiscalError
impl StructuralPartialEq for FiscalError
Auto Trait Implementations§
impl Freeze for FiscalError
impl RefUnwindSafe for FiscalError
impl Send for FiscalError
impl Sync for FiscalError
impl Unpin for FiscalError
impl UnsafeUnpin for FiscalError
impl UnwindSafe for FiscalError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.