
    GJjU
                         d dl mZmZmZmZmZ d dlmZ dedefdZ	 G d de
      Z G d d	e      Z G d
 de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zy)    )AnyTypeOptionalSetDict)is_uniontype_returnc                 ^    t        | d      rt        |       s| j                  S t        |       S )N__name__)hasattrr   r   str)r	   s    [/Users/ahmed/devFolder/claude-voice/.venv/lib/python3.12/site-packages/dacite/exceptions.py_namer      s'    $UJ75>>_UXY^U__    c                       e Zd Zy)DaciteErrorN)r   
__module____qualname__ r   r   r   r   	   s    r   r   c                   <     e Zd Zddee   f fdZdeddfdZ xZS )DaciteFieldErrorN
field_pathc                 0    t         |           || _        y N)super__init__r   selfr   	__class__s     r   r   zDaciteFieldError.__init__   s    $r   parent_field_pathr
   c                 X    | j                   r| d| j                    | _         y || _         y )N.r   )r   r!   s     r   update_pathzDaciteFieldError.update_path   s(    ??!2 31T__4EFDO/DOr   r   )r   r   r   r   r   r   r%   __classcell__r    s   @r   r   r      s&    %8C= %0S 0T 0r   r   c            	       D     e Zd Zddededee   ddf fdZdefdZ xZ	S )	WrongTypeErrorN
field_typevaluer   r
   c                 B    t         |   |       || _        || _        y Nr$   )r   r   r*   r+   )r   r*   r+   r   r    s       r   r   zWrongTypeError.__init__   s!    J/$
r   c                     d| j                    dt        | j                         d| j                   dt        t	        | j                               d	S )Nzwrong value type for field "z" - should be "z" instead of value "z" of type "")r   r   r*   r+   typer   s    r   __str__zWrongTypeError.__str__   sS    *4??*;?5QUQ`Q`KaJb c!!%Kd4::>N8O7PPQS	
r   r   )
r   r   r   r   r   r   r   r   r2   r&   r'   s   @r   r)   r)      s5    4  # Z^ 

 
r   r)   c                   8     e Zd Zddee   f fdZdefdZ xZS )MissingValueErrorr   c                 &    t         |   |       y r-   )r   r   r   s     r   r   zMissingValueError.__init__'   s    J/r   r
   c                 "    d| j                    dS )Nzmissing value for field "r/   r$   r1   s    r   r2   zMissingValueError.__str__*   s    *4??*;1==r   r   )r   r   r   r   r   r   r2   r&   r'   s   @r   r4   r4   &   s    08C= 0> >r   r4   c                       e Zd ZdefdZy)UnionMatchErrorr
   c                     dt        t        | j                               d| j                   dt        | j                         S )Nzcan not match type "z" to any type of "z	" union: )r   r0   r+   r   r*   r1   s    r   r2   zUnionMatchError.__str__/   sB    "5djj)9#:"; <??#9U4??-C,DF	
r   N)r   r   r   r   r2   r   r   r   r8   r8   .   s    
 
r   r8   c                   J     e Zd Zddeeef   dee   ddf fdZdefdZ	 xZ
S )StrictUnionMatchErrorNunion_matchesr   r
   c                 4    t         |   |       || _        y r-   )r   r   r<   )r   r<   r   r    s      r   r   zStrictUnionMatchError.__init__7   s    J/*r   c                 j    dj                  d | j                  D              }d| j                   d| S )N, c              3   2   K   | ]  }t        |        y wr   )r   ).0r	   s     r   	<genexpr>z0StrictUnionMatchError.__str__.<locals>.<genexpr><   s     %S@RueEl@Rs   z9can not choose between possible Union matches for field "z": )joinr<   r   )r   conflicting_typess     r   r2   zStrictUnionMatchError.__str__;   s8     II%S@R@R%SSJ4??J[[^_p^qrrr   r   )r   r   r   r   r   r   r   r   r   r2   r&   r'   s   @r   r;   r;   6   s8    +d49o +8C= +\` +s sr   r;   c                   4     e Zd Zdeddf fdZdefdZ xZS )ForwardReferenceErrormessager
   Nc                 0    t         |           || _        y r   )r   r   rG   )r   rG   r    s     r   r   zForwardReferenceError.__init__A   s    r   c                      d| j                    S )Nz#can not resolve forward reference: )rG   r1   s    r   r2   zForwardReferenceError.__str__E   s    4T\\NCCr   )r   r   r   r   r   r2   r&   r'   s   @r   rF   rF   @   s$      D Dr   rF   c                   :     e Zd Zdee   ddf fdZdefdZ xZS )UnexpectedDataErrorkeysr
   Nc                 0    t         |           || _        y r   )r   r   rL   )r   rL   r    s     r   r   zUnexpectedDataError.__init__J   s    	r   c                 R    dj                  d | j                  D              }d| dS )Nr?   c              3   (   K   | ]
  }d | d   yw)r/   Nr   )rA   keys     r   rB   z.UnexpectedDataError.__str__.<locals>.<genexpr>O   s     "C#Qse1:s   zcan not match z to any data class field)rC   rL   )r   formatted_keyss     r   r2   zUnexpectedDataError.__str__N   s+    "C"CC//GHHr   )r   r   r   r   r   r   r2   r&   r'   s   @r   rK   rK   I   s(    SX $ I Ir   rK   N)typingr   r   r   r   r   dacite.typesr   r   r   	Exceptionr   r   r)   r4   r8   r;   rF   rK   r   r   r   <module>rU      s    1 1 !` `# `	) 		0{ 	0

% 

>( >
n 
s, sDK DI+ Ir   