Errors¶
Error types used across the core library, FFI, and Python bindings.
Rust¶
Error types
Core error types and categories.
ErrorKind
Error
InvoiceError
ValidationError
CsrError
SigningError
XmlValidationError
InvoiceXmlError
ParseError
ZatcaError
Returns
- Typed errors for each domain (invoice, CSR, signing, XML, API).
Python¶
Exceptions
Python exception hierarchy.
FatooraError
FfiError
InvalidInputError
ValidationError
ParseError
XmlError
CryptoError
IoError
NetworkError
UnauthorizedError
InternalError
ApiError
Returns
- Typed exceptions for FFI, parsing, crypto, IO, networking, and API failures.
C (FFI)¶
FFI errors
FFI error type and helpers.
FfiErrorKind
FfiError
int fatoora_error_code(FfiError* error);
FfiString fatoora_error_message(FfiError* error);
void fatoora_error_free(FfiError* error);
Args
error: error handle returned from a failed FFI call.
Returns
code: numeric error kind (see FfiErrorKind values).message: UTF-8 error message.
Mapping (FFI -> Python)¶
Mapping
- InvalidInput -> InvalidInputError
- Validation -> ValidationError
- Parse -> ParseError
- Xml -> XmlError
- Crypto -> CryptoError
- Io -> IoError
- Network -> NetworkError
- Unauthorized -> UnauthorizedError
- Internal -> InternalError
- Api -> ApiError