b2c_tooling_sdk.errors
Error types for B2C tooling operations.
Classes
HttpError
class HttpError(Exception)Raised when an HTTP request fails.
Wraps the original httpx.Response for access to status, headers, and body. Mirrors HTTPError in the TypeScript SDK.
Attributes
| Name | Type | Description |
|---|---|---|
response | The response object from the failed request. | |
method | HTTP method used for the request (GET, POST, PUT, ...). |
NetworkError
class NetworkError(Exception)Raised when a network-layer request fails.
Attributes
| Name | Type | Description |
|---|---|---|
kind | NetworkErrorKind | Classified network error kind. |
operation | Description of the operation that failed. | |
host | Target hostname. |
Functions
classify_network_error
def classify_network_error(err: BaseException) -> NetworkErrorKindClassify a transport failure into a NetworkErrorKind.
describe_network_error_kind
def describe_network_error_kind(kind: NetworkErrorKind) -> tuple[str, str]Return a (summary, hint) pair for a network error kind.
is_network_error
def is_network_error(err: BaseException) -> boolReturn True for transport-level failures; False for HTTP/application errors.
HttpError always returns False so it passes through wrap_network_error untouched.
wrap_network_error
def wrap_network_error(err: BaseException, *, operation: str | None = None, host: str | None = None) -> BaseExceptionWrap a transport failure in a NetworkError with actionable context.
Returns the wrapped error (or the original error unchanged if it is not a network error, or already a fully-contextualized NetworkError). This function does not raise — the caller must raise the result.
Attributes
NetworkErrorKind
NetworkErrorKind = Literal['timeout', 'connection-reset', 'connection-refused', 'dns', 'tls', 'aborted', 'unknown']