o
    ¯bš  ã                   @   s€   d Z ddlZddlmZmZmZ G dd„ deƒZG dd„ deƒZG dd	„ d	eƒZ	ej
d
ee deg ef ded fdd„ƒZdS )z
HAProxy specific exceptions.
é    N)ÚCallableÚ	GeneratorÚTypec                   @   ó   e Zd ZdZdS )ÚInvalidProxyHeaderz8
    The provided PROXY protocol header is invalid.
    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   úG/usr/lib/python3/dist-packages/twisted/protocols/haproxy/_exceptions.pyr      ó    r   c                   @   r   )ÚInvalidNetworkProtocolzC
    The network protocol was not one of TCP4 TCP6 or UNKNOWN.
    Nr   r   r   r   r   r      r   r   c                   @   r   )ÚMissingAddressDataz4
    The address data is missing or incomplete.
    Nr   r   r   r   r   r      r   r   Ú
sourceTypeÚ
targetTypeÚreturn)NNNc              
   c   s6   � zdV  W dS  | y } z|ƒ   |j¡‚d}~ww )aA  
    Convert an error into a different error type.

    @param sourceType: The type of exception that should be caught and
        converted.
    @type sourceType: L{BaseException}

    @param targetType: The type of exception to which the original should be
        converted.
    @type targetType: L{BaseException}
    N)Úwith_tracebackÚ__traceback__)r   r   Úer   r   r   ÚconvertError   s   €€ÿr   )r   Ú
contextlibÚtypingr   r   r   Ú	Exceptionr   r   r   ÚcontextmanagerÚBaseExceptionr   r   r   r   r   Ú<module>   s   ÿ
ÿþ