U
    HZûa±  ã                   @   sh   d Z ddlZddl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!
Exceptions used in the Waf code
é    Nc                   @   s"   e Zd ZdZddd„Zdd„ ZdS )	ÚWafErrorzBase class for all Waf errorsÚ Nc                 C   s�   t  | ¡ || _t|t ƒrt‚g | _|r^|s6t|ƒ| _t|tƒrJ|j| _nt 	t
 ¡ d ¡| _|  jt ¡ dd… 7  _d t | j¡¡| _dS )z~
		:param msg: error message
		:type msg: string
		:param ex: exception causing this error (optional)
		:type ex: exception
		é   Néÿÿÿÿr   )Ú	ExceptionÚ__init__ÚmsgÚ
isinstanceÚAssertionErrorÚstackÚstrr   Ú	tracebackÚ
extract_tbÚsysÚexc_infoÚextract_stackÚjoinÚformat_listÚverbose_msg)Úselfr   Úex© r   ú(/wcdo/src/waf-tools/waf/waflib/Errors.pyr      s    



zWafError.__init__c                 C   s
   t | jƒS )N)r   r   )r   r   r   r   Ú__str__#   s    zWafError.__str__)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   
r   c                   @   s$   e Zd ZdZg fdd„Zdd„ ZdS )Ú
BuildErrorz0Error raised during the build and install phasesc                 C   s   || _ t | |  ¡ ¡ dS )zj
		:param error_tasks: tasks that could not complete normally
		:type error_tasks: list of task objects
		N)Útasksr   r   Úformat_error)r   Zerror_tasksr   r   r   r   (   s    zBuildError.__init__c                 C   s2   dg}| j D ]}| ¡ }|r| |¡ qd |¡S )z5Formats the error messages from the tasks that failedzBuild failedÚ
)r   r    Úappendr   )r   ÚlstZtskÚtxtr   r   r   r    0   s    
zBuildError.format_errorN)r   r   r   r   r   r    r   r   r   r   r   &   s   r   c                   @   s   e Zd ZdZdS )ÚConfigurationErrorzWConfiguration exception raised in particular by :py:meth:`waflib.Context.Context.fatal`N©r   r   r   r   r   r   r   r   r%   9   s   r%   c                   @   s   e Zd ZdZdS )Ú
TaskRescanzITask-specific exception type signalling required signature recalculationsNr&   r   r   r   r   r'   =   s   r'   c                   @   s   e Zd ZdZdS )ÚTaskNotReadyzOTask-specific exception type signalling that task signatures cannot be computedNr&   r   r   r   r   r(   A   s   r(   )	r   r   r   r   r   r   r%   r'   r(   r   r   r   r   Ú<module>   s   