# Types & Errors (/sdks/python/reference/types-and-errors)



Python surfaces rich dataclasses for messages and structured exceptions for transport failures.

## Exception hierarchy [#exception-hierarchy]

| Exception                   | Retryable | When                          |
| --------------------------- | --------- | ----------------------------- |
| `KubeMQConnectionError`     | Yes       | Network or broker unavailable |
| `KubeMQTimeoutError`        | Yes       | Deadline exceeded             |
| `KubeMQAuthenticationError` | No        | Invalid credentials           |
| `KubeMQValidationError`     | No        | Invalid parameters            |
| `KubeMQError`               | Varies    | Base exception                |

## Async variants [#async-variants]

Use `AsyncPubSubClient` and async context managers when integrating with `asyncio`. Always thread `AsyncCancellationToken` instances into subscriptions so workers can shut down cleanly.

## Resources [#resources]

* [GitHub Repository](https://github.com/kubemq-io/kubemq-Python)
* [PyPI Package](https://pypi.org/project/kubemq/)
* [Examples](/sdks/python/how-to)

## See Also [#see-also]

* [Python SDK Getting Started](/sdks/python)
