o
    tBhD                     @   s   d dl mZmZmZmZ ddlmZ ddlmZ er ddl	m
Z
 dgZ		dd	ed
eeded f  deeeeef   defddZdS )    )TYPE_CHECKING
CollectionOptionalUnion   )inspect   )GraphQLError)Nodelocated_errorNoriginal_errornodesNoner
   pathreturnc                 C   s   t | tstdt|  } t | tr| jdur| S zt| j}W n ty.   t| }Y nw z| j	}W n ty?   d}Y nw z| j
}W n tyP   d}Y nw z| jpV|}W n	 tya   Y nw t|||||| S )zLocated GraphQL Error

    Given an arbitrary Exception, presumably thrown while attempting to execute a
    GraphQL operation, produce a new GraphQLError aware of the location in the document
    responsible for the original Exception.
    zUnexpected error value: N)
isinstance	Exception	TypeErrorr   r	   r   strmessageAttributeErrorsource	positionsr   )r   r   r   r   r   r    r   r/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/graphql/error/located_error.pyr      s2   


)NN)typingr   r   r   r   pyutilsr   graphql_errorr	   language.astr
   __all__r   r   intr   r   r   r   r   <module>   s"    