U
    :vh                     @   s4   G d d de ZG dd deZG dd deZdS )c                   @   s   e Zd ZdS )FPDFExceptionN)__name__
__module____qualname__ r   r   //tmp/pip-unpacked-wheel-dvf6lv8i/fpdf/errors.pyr      s   r   c                       s2   e Zd ZdZd	 fdd	Zdd Zdd Z  ZS )
FPDFPageFormatExceptionz/Error is thrown when a bad page format is givenFc                    s0   t    |r|rtd|| _|| _|| _d S )Nz\FPDF Page Format Exception cannot be both for unknown type and for wrong number of arguments)super__init__	TypeErrorargumentunknownone)selfr   r   r   	__class__r   r   r	      s    
z FPDFPageFormatException.__init__c                 C   s&   | j j d| jd| jd| jdS )N(z, ))r   r   r   r   r   r   r   r   r   __repr__   s    $z FPDFPageFormatException.__repr__c                 C   sB   | j rd| j }n| jr*d| j d}n| j}| jj d| S )NzUnknown page format: zOnly one argument given: z. Need (height,width)z: )r   r   r   r   r   )r   resr   r   r   __str__   s    zFPDFPageFormatException.__str__)FFr   r   r   __doc__r	   r   r   __classcell__r   r   r   r   r      s   r   c                       s0   e Zd ZdZ fddZdd Zdd Z  ZS )FPDFUnicodeEncodingExceptionzYError is thrown when a character that cannot be encoded by the chosen encoder is providedc                    s    t    || _|| _|| _d S )N)r   r	   
text_index	character	font_name)r   r   r   r   r   r   r   r	   &   s    
z%FPDFUnicodeEncodingException.__init__c                 C   s,   | j j dt| jt| jt| jf dS )Nr   r   )r   r   reprr   r   r   r   r   r   r   r   ,   s    z%FPDFUnicodeEncodingException.__repr__c                 C   s   d| j  d| j d| j dS )NzCharacter "z" at index zI in text is outside the range of characters supported by the font used: "z(". Please consider using a Unicode font.)r   r   r   r   r   r   r   r   /   s    z$FPDFUnicodeEncodingException.__str__r   r   r   r   r   r   #   s   r   N)	Exceptionr   r   r   r   r   r   r   <module>   s   