
    #HJj                         d Z ddlm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 G d de      Z G d de      Zy)zExceptions module for rfc3986.   )compatc                       e Zd ZdZy)RFC3986Exceptionz-Base class for all rfc3986 exception classes.N__name__
__module____qualname____doc__     \/Users/ahmed/devFolder/claude-voice/.venv/lib/python3.12/site-packages/rfc3986/exceptions.pyr   r      s    7r   r   c                   "     e Zd ZdZ fdZ xZS )InvalidAuthorityz/Exception when the authority string is invalid.c                 p    t         t        |   dj                  t	        j
                  |                   y)z4Initialize the exception with the invalid authority.z!The authority ({0}) is not valid.N)superr   __init__formatr   to_str)self	authority	__class__s     r   r   zInvalidAuthority.__init__   s-    .077i(	
r   r   r   r	   r
   r   __classcell__r   s   @r   r   r      s    9
 
r   r   c                   "     e Zd ZdZ fdZ xZS )InvalidPortz#Exception when the port is invalid.c                 J    t         t        |   dj                  |             y)z/Initialize the exception with the invalid port.zThe port ("{0}") is not valid.N)r   r   r   r   )r   portr   s     r   r   zInvalidPort.__init__   s     k4),33D9	
r   r   r   s   @r   r   r      s    -
 
r   r   c                   "     e Zd ZdZ fdZ xZS )ResolutionErrorz1Exception to indicate a failure to resolve a URI.c                 f    t         t        |   dj                  |j	                                      y)z)Initialize the error with the failed URI.z{0} is not an absolute URI.N)r   r    r   r   unsplit)r   urir   s     r   r   zResolutionError.__init__&   s&    ot-)00?	
r   r   r   s   @r   r    r    #   s    ;
 
r   r    c                       e Zd ZdZy)ValidationErrorz,Exception raised during Validation of a URI.Nr   r   r   r   r%   r%   -   s    6r   r%   c                   "     e Zd ZdZ fdZ xZS )MissingComponentErrorz6Exception raised when a required component is missing.c                     d}t        |      dkD  rd}|| _        t        |      | _        dj	                  | j                        }t
        t        |   dj                  ||      || j                         y)z5Initialize the error with the missing component name.wasr   were, z{} {} required but missingN)	lenr#   sorted
componentsjoinr   r'   r   r   r   r#   component_namesverbr.   r   s        r   r   zMissingComponentError.__init__6   si    !#D 1YYt/
#T3(//
DAOO	
r   r   r   s   @r   r'   r'   3   s    @
 
r   r'   c                   "     e Zd ZdZ fdZ xZS )UnpermittedComponentErrorz;Exception raised when a component has an unpermitted value.c           
          t         t        |   dj                  |t	        t        |            |      |||       || _        || _        || _        y)z4Initialize the error with the unpermitted component.z.{} was required to be one of {!r} but was {!r}N)	r   r4   r   r   listr-   component_namecomponent_valueallowed_values)r   r7   r8   r9   r   s       r   r   z"UnpermittedComponentError.__init__I   sY    '7<CCVN+,
 		
 -.,r   r   r   s   @r   r4   r4   F   s    E- -r   r4   c                   "     e Zd ZdZ fdZ xZS )PasswordForbiddenzCException raised when a URL has a password in the userinfo section.c                     t        dfd      }t        t        |   dj	                   |                    | _        y)z9Initialize the error with the URI that failed validation.r"   c                       S )Nr   )r#   s   r   <lambda>z,PasswordForbidden.__init__.<locals>.<lambda>_   s    #r   z4"{}" contained a password when validation forbade itN)getattrr   r;   r   r   r#   )r   r#   r"   r   s    ` r   r   zPasswordForbidden.__init__]   s=    #y+6/BII		

 r   r   r   s   @r   r;   r;   Z   s    M r   r;   c                   "     e Zd ZdZ fdZ xZS )InvalidComponentsErrorz9Exception raised when one or more components are invalid.c                     d}t        |      dkD  rd}|| _        t        |      | _        dj	                  | j                        }t
        t        |   dj                  ||      || j                         y)z8Initialize the error with the invalid component name(s).r)   r   r*   r+   z{} {} found to be invalidN)	r,   r#   r-   r.   r/   r   rA   r   r   r0   s        r   r   zInvalidComponentsError.__init__k   si    !#D 1YYt/
$d4'..z4@OO	
r   r   r   s   @r   rA   rA   h   s    C
 
r   rA   c                       e Zd ZdZy)MissingDependencyErrorzBException raised when an IRI is encoded without the 'idna' module.Nr   r   r   r   rD   rD   {   s    Lr   rD   N)r
    r   	Exceptionr   r   r   r    r%   r'   r4   r;   rA   rD   r   r   r   <module>rG      s    $ 	y 		
' 	

" 

& 
	& 	
O 
&- -( 
_ 
&M- Mr   