
    lhs                     b    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y)	    N)Integration)SentryWsgiMiddleware)ensure_integration_enabledevent_from_exception)TrytonException)appc                   0    e Zd ZdZde Zd Zed        Zy)TrytondWSGIIntegrationtrytond_wsgiz
auto.http.c                      y N )selfs    q/var/www/pru.catia.catastroantioquia-mas.com/tasa/lib/python3.12/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       } y t        j                  j                         y )N)span_originc                     t        | t              ry t        j                         }t	        | |j
                  ddd      \  }}t        j                  ||       y )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   sO    !_-#..02#)>>'0UCt
 ((T:r   r$   c                      |       y 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   ss    +LL.55

 
$$:	;
	; 
<
	; 3(! ! %%m4r   N)__name__
__module____qualname__
identifierr)   r   staticmethodr-   r   r   r   r
   r
      s,    J*&F 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 . %5[ %5r   