o
    i                     @   sV   d dl mZ d dl mZ G dd deZededZdedee d	ee fd
dZdS )    )Optional)TypeVarc                   @   s   e Zd ZdZdS )BlockingExceptionz
    Exception raised when a request is blocked by ASM
    It derives from BaseException to avoid being caught by the general Exception handler
    N)__name__
__module____qualname____doc__ r	   r	   P/home/ubuntu/.local/lib/python3.10/site-packages/ddtrace/internal/_exceptions.pyr      s    r   E)boundexcexception_typereturnc                 C   sJ   t | |r| S | jjdv r#t| dr#| jD ]}t||}|r"|  S qdS )zaTraverse an exception and its children to find the first occurrence of a specific exception type.)BaseExceptionGroupExceptionGroup
exceptionsN)
isinstance	__class__r   hasattrr   find_exception)r   r   sub_excfoundr	   r	   r
   r      s   


r   N)typingr   r   BaseExceptionr   r   typer   r	   r	   r	   r
   <module>   s    