U
    d/e                     @   s.   d dl mZ d dlmZmZmZ dddZdS )   )ServerException)read_binary_strread_binary_uint8read_binary_int32Nc           	      C   s   t | }t| }t| }t| }tt| }d}|r@||d 7 }|dkrT||d 7 }||d | 7 }d }|rtt| }t|||dS )N z. zDB::Exceptionz. Stack trace:

)nested)r   r   boolr   read_exceptionr   )	bufZadditional_messagecodenamemessageZstack_traceZ
has_nestedZnew_messager    r   A/tmp/pip-unpacked-wheel-mds_o03w/clickhouse_driver/readhelpers.pyr	      s    r	   )N)errorsr   readerr   r   r   r	   r   r   r   r   <module>   s   