
    :jT                         d Z ddlmZ ddlmZ  G d de      Z G d de      Z G d	 d
e      Z G d de      Z	 G d de      Z
 G d de      Z G d de      Z G d de      Zy)z_
Core Exception Classes

This module provides essential exception classes for the application.
    )Optional   )ErrorReasonc                   \     e Zd ZdZej
                  dfdededee   f fdZ	de
fdZ xZS )		BaseErrorz(Base exception class for the applicationNmessagereasoncausec                 N    t         |   |       || _        || _        || _        y N)super__init__r   r	   r
   )selfr   r	   r
   	__class__s       6/root/.openclaw/workspace/harvester/core/exceptions.pyr   zBaseError.__init__   s'     	!
    returnc                 6    | j                   j                         S )z+Check if error is retryable based on reason)r	   is_retryable)r   s    r   r   zBaseError.is_retryable   s    {{''))r   )__name__
__module____qualname____doc__r   UNKNOWNstrr   	Exceptionr   boolr   __classcell__r   s   @r   r   r      sF    2
 *11%)			 	 	"		*d *r   r   c                   D     e Zd ZdZej
                  fdedef fdZ xZS )NetworkErrorzNetwork-related errorsr   r	   c                 *    t        |   d||d| y N)r   r	    r   r   )r   r   r	   kwargsr   s       r   r   zNetworkError.__init__$   s    BB6Br   )	r   r   r   r   r   NETWORK_ERRORr   r   r   r   s   @r   r!   r!   !   s+     ;F;T;T C C[ C Cr   r!   c                   4     e Zd ZdZddedee   f fdZ xZS )ValidationErrorzInput validation errorsr   fieldc                 T    t        |   d|t        j                  d| || _        y r#   )r   r   r   BAD_REQUESTr*   )r   r   r*   r&   r   s       r   r   zValidationError.__init__+   s4     	
**	
 	

 
r   r   )r   r   r   r   r   r   r   r   r   s   @r   r)   r)   (   s"    ! HSM  r   r)   c                   (     e Zd ZdZdef fdZ xZS )CoreExceptionzCore system exceptionr   c                 (    t        |   dd|i| y Nr   r$   r%   r   r   r&   r   s      r   r   zCoreException.__init__8       33F3r   r   r   r   r   r   r   r   r   s   @r   r.   r.   5       4 4 4r   r.   c                   (     e Zd ZdZdef fdZ xZS )BusinessLogicErrorzBusiness logic errorsr   c                 (    t        |   dd|i| y r0   r%   r1   s      r   r   zBusinessLogicError.__init__?   r2   r   r3   r   s   @r   r6   r6   <   r4   r   r6   c                   (     e Zd ZdZdef fdZ xZS )ProcessingErrorzProcessing-related errorsr   c                 (    t        |   dd|i| y r0   r%   r1   s      r   r   zProcessingError.__init__F   r2   r   r3   r   s   @r   r9   r9   C   s    #4 4 4r   r9   c                   (     e Zd ZdZdef fdZ xZS )RetrievalErrorzData retrieval errorsr   c                 (    t        |   dd|i| y r0   r%   r1   s      r   r   zRetrievalError.__init__M   r2   r   r3   r   s   @r   r<   r<   J   r4   r   r<   c                   (     e Zd ZdZdef fdZ xZS )ConfigurationErrorzConfiguration-related errorsr   c                 (    t        |   dd|i| y r0   r%   r1   s      r   r   zConfigurationError.__init__T   r2   r   r3   r   s   @r   r?   r?   Q   s    &4 4 4r   r?   N)r   typingr   enumsr   r   r   r!   r)   r.   r6   r9   r<   r?   r$   r   r   <module>rC      st     *	 *&C9 C	i 	4I 44 44i 44Y 44 4r   