Exceptions¶
SapRfcError ¶
Bases: Exception
Common base for all saprfclib RFC errors (D-18).
Catching SapRfcError catches every error type the client raises:
AbapApplicationError, AbapSystemFailure and CommunicationError.
AbapApplicationError ¶
Bases: SapRfcError
An ABAP-level application error returned by the called function module (D-15).
Mirrors the RFC_ERROR_INFO ABAP message fields for full pyrfc parity. Every
field may be absent in the wire error and therefore defaults to None.
Source code in src/saprfclib/exceptions.py
AbapSystemFailure ¶
Bases: SapRfcError
An ABAP system failure / short dump on the backend (D-16).
Mirrors the RFC_ERROR_INFO ABAP message fields (same set as
:class:AbapApplicationError, minus key which is absent for system
failures). Every field may be absent in the wire error and defaults to
None.
Source code in src/saprfclib/exceptions.py
CommunicationError ¶
Bases: SapRfcError
A transport/network-level communication failure (D-17).
original_exception carries the underlying transport error (e.g. an
OSError) when the failure originated below the RFC protocol layer.
Source code in src/saprfclib/exceptions.py
TransactionalError ¶
Bases: SapRfcError
A transactional RFC (tRFC/qRFC/bgRFC) error (D-18 / TRFC-08).
Raised when a TID-store operation fails, a duplicate TID is detected,
or any tRFC/qRFC/bgRFC protocol invariant is violated. Subclasses
:class:SapRfcError so except saprfclib.SapRfcError still catches it.
Source code in src/saprfclib/exceptions.py
SncError ¶
Bases: SapRfcError
GSS-API / SNC handshake or frame error (Phase 7 SNC transport).
major and minor carry the OM_uint32 GSS status codes returned by the
underlying SNC library. Subclasses :class:SapRfcError so callers can
except saprfclib.SapRfcError uniformly (D-18).
Security (threat T-07-CRED): this class is NEVER populated from credential
material. The snc_lib path, snc_myname, snc_partnername, GSS
tokens, and any name/credential bytes must never enter the message, the
major/minor fields, or the repr. Only the two GSS status codes
(and, optionally, a caller-supplied non-credential message) are carried.
Source code in src/saprfclib/exceptions.py
WebSocketError ¶
Bases: SapRfcError
WebSocket upgrade, framing, TLS, or HTTP-CONNECT-proxy error (Phase 7 wRFC).
Raised by :mod:saprfclib.ws when the RFC 6455 upgrade fails (bad status,
wrong Sec-WebSocket-Accept, or a second redirect), when the HTTP CONNECT
proxy tunnel is refused, or when a WebSocket protocol/close error occurs.
Subclasses :class:SapRfcError so callers can except saprfclib.SapRfcError
uniformly (D-18).
Security (threat T-07-PROXY-CRED): this class is NEVER populated from
credential material. ws_proxy_pass and the Proxy-Authorization value
must never enter the message or the repr. Proxy failures report only the
HTTP status code — never the credential string.
Source code in src/saprfclib/exceptions.py
PoolTimeoutError ¶
Bases: SapRfcError
A :class:~saprfclib.pool.ConnectionPool could not lend a connection in time.
Raised by ConnectionPool.acquire() when every connection is in use and the
acquire deadline elapses before one is released (POOL-04). Subclasses
SapRfcError so callers can except saprfclib.SapRfcError uniformly (D-18).
The structured diagnostic fields aid debugging an exhausted pool:
waited— seconds the caller blocked before giving up.discarded— connections found dead-on-ping and replaced during the wait.active— connections currently lent out (len(in_use)).idle— connections sitting idle (len(idle)).max_size— the pool's hard ceiling on total connections.
Security (threat T-05-P03): the diagnostic message carries only these counts
and never echoes the connection params (which hold credentials, T-04-CRED).