
    fis                     j    d dl Z d dlmZ d dlmZ d dlmZmZ d dlm	Z	 d dl
mZ  G d de          ZdS )	    N)Integration)SentryWsgiMiddleware)ensure_integration_enabledevent_from_exception)TrytonException)appc                   8    e Zd ZdZde Zd Zed             ZdS )TrytondWSGIIntegrationtrytond_wsgiz
auto.http.c                     d S N )selfs    o/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/sentry_sdk/integrations/trytond.py__init__zTrytondWSGIIntegration.__init__   s        c                  :   t          t          j        t          j                  t          _        t          t                    d             t          t          d          rt          j        fd            } d S t          j        	                               d S )N)span_originc                     t          | t                    rd S t          j                    }t	          | |j        ddd          \  }}t          j        ||           d S )NtrytondF)typehandled)client_options	mechanism)hint)
isinstancer   
sentry_sdk
get_clientr   optionscapture_event)eclienteventr   s       r   error_handlerz8TrytondWSGIIntegration.setup_once.<locals>.error_handler   sp    !_-- 	;#.002#)>'0UCC  t
 (T::::::r   r$   c                      |           d S r   r   )r   requestr!   r$   s      r   _z,TrytondWSGIIntegration.setup_once.<locals>._-   s    a     r   )
r   r   wsgi_appr
   originr   hasattrr$   error_handlersappend)r'   r$   s    @r   
setup_oncez!TrytondWSGIIntegration.setup_once   s    +L.5
 
 

 
$$:	;	;
	; 
	; 
<	;
	; 3(( 	5! ! ! ! ! ! ! %%m44444r   N)__name__
__module____qualname__
identifierr)   r   staticmethodr-   r   r   r   r
   r
      sP        J&*&&F   5 5 \5 5 5r   r
   )r   sentry_sdk.integrationsr   sentry_sdk.integrations.wsgir   sentry_sdk.utilsr   r   trytond.exceptionsr   trytond.wsgir   r
   r   r   r   <module>r8      s        / / / / / / = = = = = = M M M M M M M M . . . . . .      %5 %5 %5 %5 %5[ %5 %5 %5 %5 %5r   