Ë
    RPfE  ã                   ó  — d Z ddlmZ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 G d„ d«      Zy)z…Common DNS Exceptions.

Dnspython modules may also define their own exceptions, which will
always be subclasses of ``DNSException``.
é    )ÚOptionalÚSetc                   ó†   ‡ — e Zd ZU dZdZee   ed<    e«       Z	e
e   ed<   dZee   ed<   ˆ fd„Zd„ Zd„ Zd	„ Zˆ fd
„Zˆ xZS )ÚDNSExceptionaõ  Abstract base class shared by all dnspython exceptions.

    It supports two basic modes of operation:

    a) Old/compatible mode is used if ``__init__`` was called with
    empty *kwargs*.  In compatible mode all *args* are passed
    to the standard Python Exception class as before and all *args* are
    printed by the standard ``__str__`` implementation.  Class variable
    ``msg`` (or doc string if ``msg`` is ``None``) is returned from ``str()``
    if *args* is empty.

    b) New/parametrized mode is used if ``__init__`` was called with
    non-empty *kwargs*.
    In the new mode *args* must be empty and all kwargs must match
    those set in class variable ``supp_kwargs``. All kwargs are stored inside
    ``self.kwargs`` and used in a new ``__str__`` implementation to construct
    a formatted message based on the ``fmt`` class variable, a ``string``.

    In the simplest case it is enough to override the ``supp_kwargs``
    and ``fmt`` class variables to get nice parametrized messages.
    NÚmsgÚsupp_kwargsÚfmtc                 ó&  •—  | j                   |i |¤Ž |r( | j                  di |¤Ž| _        t        | «      | _        nt        «       | _        | j                  €| j                  | _        |rt        ‰| �   |Ž  y t        ‰| �!  | j                  «       y ©N© )	Ú_check_paramsÚ_check_kwargsÚkwargsÚstrr   ÚdictÚ__doc__ÚsuperÚ__init__©ÚselfÚargsr   Ú	__class__s      €úG/var/www/fastapitest/venv/lib/python3.12/site-packages/dns/exception.pyr   zDNSException.__init__7   s|   ø€ Øˆ×Ñ˜DÐ+ FÒ+Ùà,˜$×,Ñ,Ñ6¨vÑ6ˆDŒKÜ˜4“yˆD�Hä›&ˆDŒKØ�8‰8Ðà—|‘|ˆDŒHÙÜ‰GÑ˜dÒ#ä‰GÑ˜TŸX™XÕ&ó    c                 óJ   — |s|rt        |«      t        |«      k7  sJ d«       ‚yy)zsOld exceptions supported only args and not kwargs.

        For sanity we do not allow to mix old and new behavior.z=keyword arguments are mutually exclusive with positional argsN)Úbool)r   r   r   s      r   r   zDNSException._check_paramsG   s8   € ñ ‘6Ü˜“:¤Øó"ò ð OàNóOñ ð r   c                 ó~   — |r:t        |j                  «       «      | j                  k(  sJ d| j                  z  «       ‚|S )Nz-following set of keyword args is required: %s)ÚsetÚkeysr   )r   r   s     r   r   zDNSException._check_kwargsP   s@   € Ùä�F—K‘K“MÓ" d×&6Ñ&6Ò6ðTà>À$×BRÑBRÑSóTØ6àˆr   c                 óú   — i }|j                  «       D ]e  \  }}t        |t        t        f«      rEt        t	        t
        |«      «      ||<   t        ||   «      dk(  sŒJ||   j                  «       ||<   Œa|||<   Œg |S )z˜Format kwargs before printing them.

        Resulting dictionary has to have keys necessary for str.format call
        on fmt class variable.
        é   )ÚitemsÚ
isinstanceÚlistr   Úmapr   ÚlenÚpop)r   r   ÚfmtargsÚkwÚdatas        r   Ú_fmt_kwargszDNSException._fmt_kwargsW   sy   € ð ˆØŸ™›ò 	#‰HˆB�Ü˜$¤¤s Ô,ä"¤3¤s¨D£>Ó2�˜‘Ü�w˜r‘{Ó# qÓ(à")¨"¡+§/¡/Ó"3�G˜B’Kà"�˜’ð	#ð ˆr   c                 óÀ   •— | j                   rD| j                  r8 | j                  di | j                   ¤Ž} | j                  j                  di |¤ŽS t        ‰| �  «       S r   )r   r	   r+   Úformatr   Ú__str__)r   r(   r   s     €r   r.   zDNSException.__str__i   sP   ø€ Ø�;Š;˜4Ÿ8š8à&�d×&Ñ&Ñ5¨¯©Ñ5ˆGØ"�4—8‘8—?‘?Ñ- WÑ-Ð-ô ‘7‘?Ó$Ð$r   )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   Ú__annotations__r   r   r   r	   r   r   r   r+   r.   Ú__classcell__©r   s   @r   r   r      sU   ø… ñð, €Cˆ�#‰ÓÙ›E€K��S‘Ó!Ø€Cˆ�#‰Óô'ò Oòò÷$%ð %r   r   c                   ó   — e Zd ZdZy)Ú	FormErrorzDNS message is malformed.N©r/   r0   r1   r   r   r   r   r6   r6   s   s   „ Ú#r   r6   c                   ó   — e Zd ZdZy)ÚSyntaxErrorzText input is malformed.Nr7   r   r   r   r9   r9   w   ó   „ Ú"r   r9   c                   ó   — e Zd ZdZy)ÚUnexpectedEndzText input ended unexpectedly.Nr7   r   r   r   r<   r<   {   s   „ Ú(r   r<   c                   ó   — e Zd ZdZy)ÚTooBigzThe DNS message is too big.Nr7   r   r   r   r>   r>      s   „ Ú%r   r>   c                   ó,   ‡ — e Zd ZdZdhZdZˆ fd„Zˆ xZS )ÚTimeoutzThe DNS operation timed out.Útimeoutz7The DNS operation timed out after {timeout:.3f} secondsc                 ó$   •— t        ‰| �  |i |¤Ž y ©N)r   r   r   s      €r   r   zTimeout.__init__‹   s   ø€ Ü‰Ñ˜$Ð) &Ó)r   )r/   r0   r1   r   r   r	   r   r3   r4   s   @r   r@   r@   ƒ   s   ø„ Ù&à�+€KØ
C€C÷*ð *r   r@   c                   ó   — e Zd ZdZy)ÚUnsupportedAlgorithmz&The DNSSEC algorithm is not supported.Nr7   r   r   r   rE   rE   �   s   „ Ú0r   rE   c                   ó   — e Zd ZdZy)ÚAlgorithmKeyMismatchz=The DNSSEC algorithm is not supported for the given key type.Nr7   r   r   r   rG   rG   “   s   „ ÚGr   rG   c                   ó   — e Zd ZdZy)ÚValidationFailurez The DNSSEC signature is invalid.Nr7   r   r   r   rI   rI   —   s   „ Ú*r   rI   c                   ó   — e Zd ZdZy)ÚDeniedByPolicyzDenied by DNSSEC policy.Nr7   r   r   r   rK   rK   ›   r:   r   rK   c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)ÚExceptionWrapperc                 ó   — || _         y rC   )Úexception_class)r   rO   s     r   r   zExceptionWrapper.__init__    s
   € Ø.ˆÕr   c                 ó   — | S rC   r   )r   s    r   Ú	__enter__zExceptionWrapper.__enter__£   s   € Øˆr   c                 ój   — |�1t        || j                  «      s| j                  t        |«      «      |‚y)NF)r#   rO   r   )r   Úexc_typeÚexc_valÚexc_tbs       r   Ú__exit__zExceptionWrapper.__exit__¦   s1   € ØÐ¬
°7¸D×<PÑ<PÔ(QØ×&Ñ&¤s¨7£|Ó4¸'ÐAØr   N)r/   r0   r1   r   rQ   rV   r   r   r   rM   rM   Ÿ   s   „ ò/òór   rM   N)r   Útypingr   r   Ú	Exceptionr   r6   r9   r<   r>   r@   rE   rG   rI   rK   rM   r   r   r   ú<module>rY      s—   ðñ$÷ !ôT%�9ô T%ôn$�ô $ô#�,ô #ô)�Kô )ô&ˆ\ô &ô	*ˆlô 	*ô1˜<ô 1ôHÐ/ô Hô+˜ô +ô#�\ô #÷
ò 
r   