o
    8Di                     @   s   d Z ddlmZ G dd deZG dd deZG dd deZG d	d
 d
eZG dd deZG dd deZ	G dd deZ
G dd deZG dd deZG dd deZdS )zExceptions module for rfc3986.   )compatc                   @      e Zd ZdZdS )RFC3986Exceptionz-Base class for all rfc3986 exception classes.N__name__
__module____qualname____doc__ r
   r
   K/var/www/Datamplify/venv/lib/python3.10/site-packages/rfc3986/exceptions.pyr          r   c                           e Zd ZdZ fddZ  ZS )InvalidAuthorityz/Exception when the authority string is invalid.c                    s   t  dt| d dS )z4Initialize the exception with the invalid authority.zThe authority (z) is not valid.N)super__init__r   to_str)self	authority	__class__r
   r   r      s   zInvalidAuthority.__init__r   r   r   r	   r   __classcell__r
   r
   r   r   r          r   c                       r   )InvalidPortz#Exception when the port is invalid.c                    s   t  d| d dS )z/Initialize the exception with the invalid port.zThe port ("z") is not valid.N)r   r   )r   portr   r
   r   r      s   zInvalidPort.__init__r   r
   r
   r   r   r      r   r   c                       r   )ResolutionErrorz1Exception to indicate a failure to resolve a URI.c                    s   t  d|  dS )z)Initialize the error with the failed URI.z1{} does not meet the requirements for resolution.N)r   r   formatunsplit)r   urir   r
   r   r       s
   zResolutionError.__init__r   r
   r
   r   r   r      r   r   c                   @   r   )ValidationErrorz,Exception raised during Validation of a URI.Nr   r
   r
   r
   r   r   )   r   r   c                       r   )MissingComponentErrorz6Exception raised when a required component is missing.c                    R   d}t |dkr
d}|| _t|| _d| j}t | d| d|| j dS )z5Initialize the error with the missing component name.wasr   were,  z required but missingNlenr   sorted
componentsjoinr   r   r   r   component_namesverbr)   r   r
   r   r   2      
zMissingComponentError.__init__r   r
   r
   r   r   r    /   r   r    c                       r   )UnpermittedComponentErrorz;Exception raised when a component has an unpermitted value.c                    s:   t  d|tt||||| || _|| _|| _dS )z4Initialize the error with the unpermitted component.z.{} was required to be one of {!r} but was {!r}N)r   r   r   listr(   component_namecomponent_valueallowed_values)r   r1   r2   r3   r   r
   r   r   E   s   


z"UnpermittedComponentError.__init__r   r
   r
   r   r   r/   B   r   r/   c                       r   )PasswordForbiddenzCException raised when a URL has a password in the userinfo section.c                    s2   t  d fdd}t d|   | _dS )z9Initialize the error with the URI that failed validation.r   c                      s    S )Nr
   r
   r   r
   r   <lambda>[   s    z,PasswordForbidden.__init__.<locals>.<lambda>z4"{}" contained a password when validation forbade itN)getattrr   r   r   r   )r   r   r   r   r5   r   r   Y   s   
zPasswordForbidden.__init__r   r
   r
   r   r   r4   V   r   r4   c                       r   )InvalidComponentsErrorz9Exception raised when one or more components are invalid.c                    r!   )z8Initialize the error with the invalid component name(s).r"   r   r#   r$   r%   z found to be invalidNr&   r+   r   r
   r   r   g   r.   zInvalidComponentsError.__init__r   r
   r
   r   r   r8   d   r   r8   c                   @   r   )MissingDependencyErrorzBException raised when an IRI is encoded without the 'idna' module.Nr   r
   r
   r
   r   r9   w   s    r9   N)r	    r   	Exceptionr   r   r   r   r   r    r/   r4   r8   r9   r
   r
   r
   r   <module>   s    
