JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/dns/__pycache__/exception.cpython-39.opt-1.pyc

a

�M�eE�@s�dZddlmZmZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�ZGdd�de�Z	Gd
d�de�Z
Gdd�de�ZGdd�de�ZGdd�de�Z
Gdd�de�ZGdd�d�ZdS)z�Common DNS Exceptions.

Dnspython modules may also define their own exceptions, which will
always be subclasses of ``DNSException``.
�)�Optional�SetcsxeZdZUdZdZeeed<e�Z	e
eed<dZeeed<�fdd�Zdd	�Z
d
d�Zdd
�Z�fdd�Z�ZS)�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�fmtcsp|j|i|��|r2|jfi|��|_t|�|_nt�|_|jdurL|j|_|r^t�j|�nt��|j�dS�N)	�
_check_params�
_check_kwargs�kwargs�strr�dict�__doc__�super�__init__��self�argsr��	__class__��1/usr/lib/python3.9/site-packages/dns/exception.pyr7s
zDNSException.__init__cOs|s|rdS)zsOld exceptions supported only args and not kwargs.

        For sanity we do not allow to mix old and new behavior.Nrrrrrr	GszDNSException._check_paramscKs|r|Srr)rrrrrr
PszDNSException._check_kwargscKsdi}|��D]R\}}t|ttf�rVttt|��||<t||�dkr^||��||<q|||<q|S)z�Format kwargs before printing them.

        Resulting dictionary has to have keys necessary for str.format call
        on fmt class variable.
        �)�items�
isinstance�list�set�mapr�len�pop)rr�fmtargs�kw�datarrr�_fmt_kwargsWs
zDNSException._fmt_kwargscs>|jr0|jr0|jfi|j��}|jjfi|��St���SdSr)rrr#�formatr�__str__)rr rrrr%iszDNSException.__str__)�__name__�
__module__�__qualname__rrrr�__annotations__rrrrrr	r
r#r%�
__classcell__rrrrrs
	rc@seZdZdZdS)�	FormErrorzDNS message is malformed.N�r&r'r(rrrrrr+ssr+c@seZdZdZdS)�SyntaxErrorzText input is malformed.Nr,rrrrr-wsr-c@seZdZdZdS)�
UnexpectedEndzText input ended unexpectedly.Nr,rrrrr.{sr.c@seZdZdZdS)�TooBigzThe DNS message is too big.Nr,rrrrr/sr/cs*eZdZdZdhZdZ�fdd�Z�ZS)�TimeoutzThe DNS operation timed out.�timeoutz7The DNS operation timed out after {timeout:.3f} secondscst�j|i|��dSr)rrrrrrr�szTimeout.__init__)r&r'r(rrrrr*rrrrr0�sr0c@seZdZdZdS)�UnsupportedAlgorithmz&The DNSSEC algorithm is not supported.Nr,rrrrr2�sr2c@seZdZdZdS)�AlgorithmKeyMismatchz=The DNSSEC algorithm is not supported for the given key type.Nr,rrrrr3�sr3c@seZdZdZdS)�ValidationFailurez The DNSSEC signature is invalid.Nr,rrrrr4�sr4c@seZdZdZdS)�DeniedByPolicyzDenied by DNSSEC policy.Nr,rrrrr5�sr5c@s$eZdZdd�Zdd�Zdd�ZdS)�ExceptionWrappercCs
||_dSr)�exception_class)rr7rrrr�szExceptionWrapper.__init__cCs|Srr)rrrr�	__enter__�szExceptionWrapper.__enter__cCs(|dur$t||j�s$|�t|��|�dS)NF)rr7r)r�exc_typeZexc_valZexc_tbrrr�__exit__�szExceptionWrapper.__exit__N)r&r'r(rr8r:rrrrr6�sr6N)r�typingrr�	Exceptionrr+r-r.r/r0r2r3r4r5r6rrrr�<module>sW
Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a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