
    'XhP                     v    d dl Z d dlmZmZmZ d dlmZmZ dZ G d de	      Z
 G d de
      Z G d	 d
e
      Zy)    N)AnyDictOptional)HeadersResponse   c                       e Zd ZdZy)ApiExceptionz
Base classN)__name__
__module____qualname____doc__     G/RAG/venv/lib/python3.12/site-packages/qdrant_client/http/exceptions.pyr
   r
   	   s    r   r
   c            
       j    e Zd Zdee   dedededdf
dZe	de
dd	fd
       ZdefdZdeeef   fdZy)UnexpectedResponsestatus_codereason_phrasecontentheadersreturnNc                 <    || _         || _        || _        || _        y Nr   r   r   r   )selfr   r   r   r   s        r   __init__zUnexpectedResponse.__init__   s     &*r   responser
   c                 p    t        | j                  | j                  | j                  | j                        S )Nr   )r   r   r   r   r   )r   s    r   for_responsezUnexpectedResponse.for_response   s3    ! ,,"00$$$$	
 	
r   c                 Z   | j                   | j                    nd}| j                  dk(  r| j                   d}nd| j                   d}| d| j                         }t        | j                        t
        k  r| j                  n| j                  d t
        dz
   dz   }d|}d	| d
| S )N z(Unrecognized Status Code)()    s    ...zRaw response content:
zUnexpected Response: 
)r   r   striplenr   MAX_CONTENT)r   status_code_strreason_phrase_str
status_strshort_contentraw_content_strs         r   __str__zUnexpectedResponse.__str__   s    373C3C3OT--.UW#(8(8(D <"#D$6$6#7q 9'(*;)<=CCE
(+DLL(9[(Hdll[l]hkl]lNmpwNw3M3DE&zl"_4EFFr   c                 @    t        j                  | j                        S r   )jsonloadsr   )r   s    r   
structuredzUnexpectedResponse.structured(   s    zz$,,''r   )r   r   r   r   intstrbytesr   r   staticmethodr   r    r0   r   r   r4   r   r   r   r   r      su    HSM # PU `g lp  
x 
N 
 
	G 	G(DcN (r   r   c                       e Zd ZdefdZy)ResponseHandlingExceptionsourcec                     || _         y r   )r;   )r   r;   s     r   r   z"ResponseHandlingException.__init__-   s	    r   N)r   r   r   	Exceptionr   r   r   r   r:   r:   ,   s    y r   r:   )r2   typingr   r   r   httpxr   r   r*   r=   r
   r   r:   r   r   r   <module>r@      s:     & & #9 ( (> r   