<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
dŠáW  ã               @   sh   d 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Common DNS Exceptions.c                   sR   e Zd ZdZdZeƒ ZdZ‡ fdd„Zdd„ Z	dd„ Z
d	d
„ Z‡ fdd„Z‡  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 standard Python Exception class
    as before and all *args are printed by 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 has to be empty and all kwargs has to exactly match
    set in class variable self.supp_kwargs. All kwargs are stored inside
    self.kwargs and used in new __str__ implementation to construct
    formatted message based on self.fmt string.

    In the simplest case it is enough to override supp_kwargs and fmt
    class variables to get nice parametrized messages.
    Nc                sp   | j ||Ž |r*| jf |Ž| _t| ƒ| _ntƒ | _| jd krD| j| _|rZtt| ƒj	|Ž  ntt| ƒj	| jƒ d S )N)
Ú_check_paramsÚ_check_kwargsÚkwargsÚstrÚmsgÚdictÚ__doc__Úsuperr   Ú__init__)ÚselfÚargsr   )Ú	__class__© ú/usr/lib/python3.6/exception.pyr
   .   s    
zDNSException.__init__c             O   s   |s|rdS )zsOld exceptions supported only args and not kwargs.

        For sanity we do not allow to mix old and new behavior.Nr   )r   r   r   r   r   r   r   =   s    zDNSException._check_paramsc             K   s   |r|S )Nr   )r   r   r   r   r   r   E   s    zDNSException._check_kwargsc             K   sh   i }x^|j ƒ D ]R\}}t|ttfƒrXttt|ƒƒ||< t|| ƒdkr`|| jƒ ||< q|||< qW |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)r   r   ÚfmtargsÚkwÚdatar   r   r   Ú_fmt_kwargsL   s    zDNSException._fmt_kwargsc                s:   | j r(| jr(| jf | j Ž}| jjf |ŽS tt| ƒjƒ S d S )N)r   Úfmtr   Úformatr	   r   Ú__str__)r   r   )r   r   r   r   ^   s    zDNSException.__str__)Ú__name__Ú
__module__Ú__qualname__r   r   r   Úsupp_kwargsr   r
   r   r   r   r   Ú__classcell__r   r   )r   r   r      s   r   c               @   s   e Zd ZdZdS )Ú	FormErrorzDNS message is malformed.N)r   r    r!   r   r   r   r   r   r$   h   s   r$   c               @   s   e Zd ZdZdS )ÚSyntaxErrorzText input is malformed.N)r   r    r!   r   r   r   r   r   r%   m   s   r%   c               @   s   e Zd ZdZdS )ÚUnexpectedEndzText input ended unexpectedly.N)r   r    r!   r   r   r   r   r   r&   r   s   r&   c               @   s   e Zd ZdZdS )ÚTooBigzThe DNS message is too big.N)r   r    r!   r   r   r   r   r   r'   w   s   r'   c               @   s   e Zd ZdZedgƒZdZdS )ÚTimeoutzThe DNS operation timed out.Ztimeoutz3The DNS operation timed out after {timeout} secondsN)r   r    r!   r   r   r"   r   r   r   r   r   r(   |   s   
r(   N)r   Ú	Exceptionr   r$   r%   r&   r'   r(   r   r   r   r   Ú<module>   s   U