Errors
Ta treść nie jest jeszcze dostępna w Twoim języku.
Generated from ksef2.core.exceptions.
| Class | Code | Summary | Constructor | Source |
|---|---|---|---|---|
KSeFException | SDK_ERROR | Base exception for all KSeF SDK errors. | KSeFException( message: str, ) -> None | src/ksef2/core/exceptions.py:26 |
KSeFClientClosedError | CLIENT_CLOSED | Raised when an SDK client is used after it has been closed. | KSeFClientClosedError(message: str, **context: Any) -> KSeFClientClosedError | src/ksef2/core/exceptions.py:37 |
KSeFUnsupportedEnvironmentError | UNSUPPORTED_ENVIRONMENT | Raised when an operation is not available in the selected environment. | KSeFUnsupportedEnvironmentError(message: str, **context: Any) -> KSeFUnsupportedEnvironmentError | src/ksef2/core/exceptions.py:43 |
KSeFValidationError | VALIDATION_ERROR | Raised when validation fails. | KSeFValidationError( message: str, ) -> None | src/ksef2/core/exceptions.py:49 |
KSeFInvoiceRenderingError | INVOICE_RENDERING_ERROR | Raised when invoice rendering fails. | KSeFInvoiceRenderingError(message: str, **context: Any) -> KSeFInvoiceRenderingError | src/ksef2/core/exceptions.py:59 |
KSeFApiError | API_ERROR | Raised on 4xx/5xx responses from the KSeF API. | KSeFApiError( status_code: int, exception_code: ExceptionCode, message: str, response: BaseModel | None = None, ) -> None | src/ksef2/core/exceptions.py:65 |
KSeFAuthError | AUTH_ERROR | Raised on 401/403 responses. | KSeFAuthError( status_code: int, message: str, response: BaseModel | None = None, ) -> None | src/ksef2/core/exceptions.py:89 |
KSeFRateLimitError | RATE_LIMIT_ERROR | Raised on 429 responses. Check retry_after for seconds to wait. | KSeFRateLimitError( retry_after: int | None, message: str, response: BaseModel | None = None, ) -> None | src/ksef2/core/exceptions.py:103 |
KSeFEncryptionError | ENCRYPTION_ERROR | Raised when encryption or decryption operations fail. | KSeFEncryptionError( message: str, ) -> None | src/ksef2/core/exceptions.py:119 |
KSeFSessionError | SESSION_ERROR | Raised on session-state violations (e.g. sending invoice on closed session). | KSeFSessionError( message: str, ) -> None | src/ksef2/core/exceptions.py:131 |
NoCertificateAvailableError | NO_CERTIFICATE_AVAILABLE | Raised when no certificate is available for signing. | NoCertificateAvailableError( message: str, ) -> None | src/ksef2/core/exceptions.py:143 |
KSeFExportTimeoutError | EXPORT_TIMEOUT | Raised when polling for an export package exceeds the timeout. | KSeFExportTimeoutError( reference_number: str, timeout: float, ) -> None | src/ksef2/core/exceptions.py:155 |
KSeFAuthPollingTimeoutError | AUTH_POLLING_TIMEOUT | Raised when polling for authentication completion exceeds the timeout. | KSeFAuthPollingTimeoutError( reference_number: str, timeout: float, ) -> None | src/ksef2/core/exceptions.py:174 |
KSeFTokenStatusTimeoutError | TOKEN_STATUS_TIMEOUT | Raised when polling for a token status change exceeds the timeout. | KSeFTokenStatusTimeoutError( reference_number: str, timeout: float, ) -> None | src/ksef2/core/exceptions.py:193 |
KSeFInvoiceQueryTimeoutError | INVOICE_QUERY_TIMEOUT | Raised when polling for invoices to appear exceeds the timeout. | KSeFInvoiceQueryTimeoutError( timeout: float, ) -> None | src/ksef2/core/exceptions.py:212 |
KSeFMetadataPaginationError | METADATA_PAGINATION_ERROR | Raised when metadata pagination cannot continue safely. | KSeFMetadataPaginationError(message: str, **context: Any) -> KSeFMetadataPaginationError | src/ksef2/core/exceptions.py:225 |
KSeFInvoiceDownloadTimeoutError | INVOICE_DOWNLOAD_TIMEOUT | Raised when polling for an invoice download exceeds the timeout. | KSeFInvoiceDownloadTimeoutError( ksef_number: str, timeout: float, ) -> None | src/ksef2/core/exceptions.py:231 |
KSeFInvoiceProcessingTimeoutError | INVOICE_PROCESSING_TIMEOUT | Raised when polling for a session invoice to finish processing exceeds the timeout. | KSeFInvoiceProcessingTimeoutError( invoice_reference_number: str, timeout: float, ) -> None | src/ksef2/core/exceptions.py:246 |
KSeFBatchSessionTimeoutError | BATCH_SESSION_TIMEOUT | Raised when polling for a batch session to finish processing exceeds the timeout. | KSeFBatchSessionTimeoutError( reference_number: str, timeout: float, ) -> None | src/ksef2/core/exceptions.py:261 |
ExceptionCode values
Section titled “ExceptionCode values”| Name | Value |
|---|---|
UNKNOWN_ERROR | 10000 |
OBJECT_ALREADY_EXISTS | 30001 |
VALIDATION_ERROR | 21405 |
UPO_NOT_FOUND | 21178 |
NOT_PROCESSED_YET | 21165 |