Ttebra_soap_apiAsync Tebra SOAP 2.1
SOAP 2.1
Getting started

Exceptions

All library errors derive from TebraError, so one except can catch everything. Specific subclasses add operation context and structured payloads.

Hierarchy

TebraError
├─ TebraConfigError
├─ TebraReadOnlyError
├─ TebraAuthError
├─ TebraAPIError
├─ TebraThrottleError
├─ TebraSOAPFault
└─ TebraNotFoundError (also a LookupError)

Catching errors

from tebra_soap_api import (
    TebraAPIError,
    TebraAuthError,
    TebraError,
    TebraThrottleError,
)

try:
    patient = await client.get_patient(patient_id=119246)
except TebraAuthError as exc:
    print("check credentials:", exc.operation, exc.security_response)
except TebraThrottleError as exc:
    print("slow down:", exc.operation, exc.throttle_ms)
except TebraAPIError as exc:
    print("Tebra said:", exc, exc.stack_trace)
except TebraError as exc:
    print("other Tebra error:", exc)

Base classes

TebraError#

class TebraError(Exception)

Base class for every error raised by the wrapper. Catch this to handle all library failures uniformly.

TebraConfigError#

class TebraConfigError(TebraError)

Configuration is missing or invalid, for example a blank user, password, or customer_key.

Raised whenA required credential is absent after explicit arguments, environment variables, and .env resolution.

TebraReadOnlyError#

class TebraReadOnlyError(TebraError)

A mutating operation was attempted while the client is in read_only mode. The operation is rejected locally before any network request.

Attributes
ParameterTypeDescription
operationstrThe blocked SOAP operation name.
Raised whenoperation is present in WRITE_OPERATIONS and read_only=True.

TebraAuthError#

class TebraAuthError(TebraError)

Tebra rejected the credentials, CustomerKey, or permissions.

Attributes
ParameterTypeDescription
operationstr | NoneThe SOAP operation that failed.
security_responsedict | NoneThe returned security payload for diagnostics.
Raised whenIsAuthorized=False from GetCustomerIdFromKey, or any SecurityResponse flag reports failure.

TebraAPIError#

class TebraAPIError(TebraError)

Tebra returned ErrorResponse.IsError == True.

Attributes
ParameterTypeDescription
operationstr | NoneThe SOAP operation that failed.
stack_tracestr | NoneServer-side stack trace, when supplied.
raw_responsedict | NoneThe full plain-dict response.
Raised whenThe response contains an ErrorResponse with IsError=True.

TebraThrottleError#

class TebraThrottleError(TebraError)

An endpoint rate limit was hit and retries were exhausted or not applicable.

Attributes
ParameterTypeDescription
operationstr | NoneThe throttled SOAP operation.
throttle_msfloat | NoneThe client-side interval in milliseconds for that endpoint.
Raised whenTebra returns a throttle ErrorResponse, or malformed throttle XML after the configured retries.

TebraSOAPFault#

class TebraSOAPFault(TebraError)

The SOAP server returned a SOAP Fault, or the response could not be parsed as expected SOAP XML.

Attributes
ParameterTypeDescription
operationstr | NoneThe SOAP operation that faulted.
codestr | NoneSOAP fault code, when present.
detailAnySOAP fault detail, when present.
Raised whenZeep raises Fault, or an XMLParseError is not a throttle response.

TebraNotFoundError#

class TebraNotFoundError(TebraError, LookupError)

A requested resource could not be resolved. It is also a LookupError, so existing lookup handlers continue to work.

Raised whenA practice cannot be resolved, or encounters.resolve_context finds no matching patient.

Related