
    j                         d dl mZ d dlmZ  G d de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dS )    )ABCwrapsc                   0    e Zd ZU eed<   ed             ZdS )CustomErrorerror_stringc                 @     t                     fd            }|S )z
        Provides a wrapper for a function that catches any exception and
        re-raises it as the customer error. If the exception itself is already an instance
        of the custom error, re-raises original error.
        c                      	  | i |S # t           $ rd}t          |          sNt          t          |                    s1 j                            t          |                              | d }~ww xY w)N)BaseException
isinstance
issubclasstyper   formatstr)argskwargserrorclsfs      c/lsinfo/ai/hellotax_ai/base_platform/venv/lib/python3.11/site-packages/unstructured/ingest/error.pywrapperz!CustomError.wrap.<locals>.wrapper   s    q$)&)))    !%-- Njec6R6R N#c.55c%jjAABBMs    
A9AA44A9r   )r   r   r   s   `` r   wrapzCustomError.wrap   s;     
q	 	 	 	 	 
	     N)__name__
__module____qualname__r   __annotations__classmethodr    r   r   r   r      s;           [  r   r   c                       e Zd ZdZdS )SourceConnectionErrorz3Error in getting data from upstream data source: {}Nr   r   r   r   r   r   r   r!   r!      s        HLLLr   r!   c                       e Zd ZdZdS )SourceConnectionNetworkErrorz/Error in connecting to upstream data source: {}Nr"   r   r   r   r$   r$       s        DLLLr   r$   c                       e Zd ZdZdS )DestinationConnectionErrorz1Error in connecting to downstream data source: {}Nr"   r   r   r   r&   r&   $   s        FLLLr   r&   c                       e Zd ZdZdS )EmbeddingEncoderConnectionErrorz7Error in connecting to the embedding model provider: {}Nr"   r   r   r   r(   r(   (   s        LLLLr   r(   c                       e Zd ZdZdS )
WriteErrorz.Error in writing to downstream data source: {}Nr"   r   r   r   r*   r*   ,   s        CLLLr   r*   c                       e Zd ZdZdS )PartitionErrorz!Error in partitioning content: {}Nr"   r   r   r   r,   r,   0   s        6LLLr   r,   N)abcr   	functoolsr   	Exceptionr   r!   r$   r&   r(   r*   r,   r   r   r   <module>r0      s                  )S   .I I I I IK I I IE E E E E#8 E E EG G G G G G G GM M M M Mk M M MD D D D D D D D7 7 7 7 7[ 7 7 7 7 7r   