
    g	                    J   d dl mZ d dlmZ er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 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)    )annotations)TYPE_CHECKING)Aliasc                      e Zd ZdZy)GriffeError)The base exception for all Griffe errors.N__name__
__module____qualname____doc__     G/var/www/openai/venv/lib/python3.12/site-packages/_griffe/exceptions.pyr   r          3r   r   c                      e Zd ZdZy)LoadingErrorr   Nr	   r   r   r   r   r      r   r   r   c                      e Zd ZdZy)NameResolutionErrorz>Exception for names that cannot be resolved in a object scope.Nr	   r   r   r   r   r      s    Hr   r   c                      e Zd ZdZy)UnhandledEditableModuleErrorzBException for unhandled editables modules, when searching modules.Nr	   r   r   r   r   r      s    Lr   r   c                      e Zd ZdZy)UnimportableModuleErrorz.Exception for modules that cannot be imported.Nr	   r   r   r   r   r      s    8r   r   c                  $     e Zd ZdZd fdZ xZS )AliasResolutionErrorz,Exception for alias that cannot be resolved.c                    || _         	 d|j                   d|j                   }	 |j                  j                  }|d| d|j
                   dz  }t        | !  |       y# t        $ r Y w xY w)zpInitialize the exception.

        Parameters:
            alias: The alias that could not be resolved.
        zCould not resolve alias z pointing at z (in :)N)	aliaspathtarget_pathparentrelative_filepathalias_linenoBuiltinModuleErrorsuper__init__)selfr   messagefilepath	__class__s       r   r'   zAliasResolutionError.__init__"   s     "
1,UZZLeFWFWEXY	@||55H xj%*<*<)=Q??G!	 " 		s   A# #	A/.A/)r   r   returnNoner
   r   r   r   r'   __classcell__r+   s   @r   r   r      s    6" "r   r   c                  $     e Zd ZdZd fdZ xZS )CyclicAliasErrorz5Exception raised when a cycle is detected in aliases.c                l    || _         	 t        | 	  ddj                  | j                         z          y)z{Initialize the exception.

        Parameters:
            chain: The cyclic chain of items (such as target path).
        zCyclic aliases detected:
  z
  N)chainr&   r'   join)r(   r4   r+   s     r   r'   zCyclicAliasError.__init__8   s/     !&
:7&++djj:QQRr   )r4   z	list[str]r,   r-   r.   r0   s   @r   r2   r2   5   s    ?	S 	Sr   r2   c                      e Zd ZdZy)LastNodeErrorz?Exception raised when trying to access a next or previous node.Nr	   r   r   r   r7   r7   D   s    Ir   r7   c                      e Zd ZdZy)RootNodeErrorzGException raised when trying to use siblings properties on a root node.Nr	   r   r   r   r9   r9   H   s    Qr   r9   c                      e Zd ZdZy)r%   zHException raised when trying to access the filepath of a builtin module.Nr	   r   r   r   r%   r%   L   s    Rr   r%   c                      e Zd ZdZy)ExtensionErrorz+Base class for errors raised by extensions.Nr	   r   r   r   r<   r<   P       5r   r<   c                      e Zd ZdZy)ExtensionNotLoadedErrorz7Exception raised when an extension could not be loaded.Nr	   r   r   r   r?   r?   T   s    Ar   r?   c                      e Zd ZdZy)GitErrorz+Exception raised for errors related to Git.Nr	   r   r   r   rA   rA   X   r=   r   rA   N)
__future__r   typingr   _griffe.modelsr   	Exceptionr   r   r   r   r   r   r2   r7   r9   r%   r<   r?   rA   r   r   r   <module>rF      s    #  $4) 44; 4I+ IM; M9k 9"; ",S{ SJK JRK RS S6[ 6Bn B6{ 6r   