a
    L±Ög)  ã                   @   sP   d Z ddlmZ ddlmZ G dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZdS )z²
QAPI error classes

Common error classes used throughout the package.  Additional errors may
be defined in other modules.  At present, `QAPIParseError` is defined in
parser.py.
é    )ÚOptionalé   )ÚQAPISourceInfoc                   @   s   e Zd ZdZdS )Ú	QAPIErrorz4Base class for all exceptions from the QAPI package.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   ú=/home2/Puru_Virtio_Blk/virtio-demo/qemu/scripts/qapi/error.pyr      s   r   c                       sB   e Zd ZdZd	ee eee dœ‡ fdd„Zedœdd„Z	‡  Z
S )
ÚQAPISourceErrorz=Error class for all exceptions identifying a source location.N)ÚinfoÚmsgÚcolc                    s    t ƒ  ¡  || _|| _|| _d S )N)ÚsuperÚ__init__r   r   r   )Úselfr   r   r   ©Ú	__class__r   r   r      s    
zQAPISourceError.__init__)Úreturnc                 C   sN   | j d usJ ‚t| j ƒ}| jd ur@| j jd us2J ‚|d| j 7 }|d | j S )Nz:%sz: )r   Ústrr   Úliner   )r   Úlocr   r   r   Ú__str__(   s    

zQAPISourceError.__str__)N)r   r   r	   r
   r   r   r   Úintr   r   Ú__classcell__r   r   r   r   r      s    ýý	r   c                   @   s   e Zd ZdZdS )ÚQAPISemErrorz%Error class for semantic QAPI errors.Nr   r   r   r   r   r   1   s   r   N)	r
   Útypingr   Úsourcer   Ú	Exceptionr   r   r   r   r   r   r   Ú<module>   s
   