o
    ¥ip  ã                   @   sp   d dl mZ erddlm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 )é    )ÚTYPE_CHECKINGé   )ÚSnapshotStatusc                       ó2   e Zd ZU dZeed< 	 def‡ fdd„Z‡  ZS )ÚGraphSetupErrorz0Error caused by an incorrectly configured graph.Úmessagec                    ó   || _ tƒ  |¡ d S ©N©r   ÚsuperÚ__init__©Úselfr   ©Ú	__class__© ú_/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/pydantic_graph/exceptions.pyr      ó   zGraphSetupError.__init__©Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚstrÚ__annotations__r   Ú__classcell__r   r   r   r   r      ó
   
 r   c                       r   )ÚGraphBuildingErrorz&An error raised during graph-building.r   c                    r   r	   r
   r   r   r   r   r      r   zGraphBuildingError.__init__r   r   r   r   r   r      r   r   c                       r   )ÚGraphValidationErrorz(An error raised during graph validation.r   c                    r   r	   r
   r   r   r   r   r   #   r   zGraphValidationError.__init__r   r   r   r   r   r      r   r   c                       r   )ÚGraphRuntimeErrorz0Error caused by an issue during graph execution.r   c                    r   r	   r
   r   r   r   r   r   .   r   zGraphRuntimeError.__init__r   r   r   r   r   r   (   r   r   c                       s0   e Zd ZdZd‡ fdd„Zedd	d
„ƒZ‡  ZS )ÚGraphNodeStatusErrorzdError caused by trying to run a node that already has status `'running'`, `'success'`, or `'error'`.Úactual_statusr   c                    s   || _ tƒ  d|›d¡ d S )NzIncorrect snapshot status z!, must be 'created' or 'pending'.)r!   r   r   )r   r!   r   r   r   r   6   s   zGraphNodeStatusError.__init__ÚstatusÚreturnNc                 C   s   |dvr| |ƒ‚dS )zCheck if the status is valid.>   ÚcreatedÚpendingNr   )Úclsr"   r   r   r   Úcheck:   s   ÿzGraphNodeStatusError.check)r!   r   )r"   r   r#   N)r   r   r   r   r   Úclassmethodr'   r   r   r   r   r   r    3   s
    r    N)Útypingr   Úpersistencer   Ú	TypeErrorr   Ú
ValueErrorr   r   ÚRuntimeErrorr   r    r   r   r   r   Ú<module>   s    