Go to the latest version of this document.

# ``twisted`.`protocols`.`haproxy`.`_exceptions``

module documentation
(source)

HAProxy specific exceptions.

Exception | `InvalidNetworkProtocol` | The network protocol was not one of TCP4 TCP6 or UNKNOWN.
Exception | `InvalidProxyHeader` | The provided PROXY protocol header is invalid.
Exception | `MissingAddressData` | The address data is missing or incomplete.
Function | `convertError` | Convert an error into a different error type.

@contextlib.contextmanager
def convertError(sourceType: `type[BaseException]`, targetType: `Callable[[], BaseException]`) -> `Generator[None, None, None]`: (source)

Convert an error into a different error type.

Parameters
sourceType:`BaseException` | The type of exception that should be caught and converted.
targetType:`BaseException` | The type of exception to which the original should be converted.

Returns
`Generator[None, None, None]` | Undocumented