Ë
    S>{iÑ  ã                   ó–   — d dl Zd dlZd dlZd dlZd dlmZ d dlmZ d dl	m
Z
 erd dlmZ  G d„ dej                  j                  «      Zy)é    N)ÚTYPE_CHECKING)ÚTrytonException)Úapp)ÚAnyc                   ó&   — e Zd ZdZd„ Zed„ «       Zy)ÚTrytondWSGIIntegrationÚtrytond_wsgic                  ó   — y ©N© )Úselfs    ú]/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/sentry_sdk/integrations/trytond.pyÚ__init__zTrytondWSGIIntegration.__init__   s   € Øó    c                  ó  ‡— t         j                  j                  j                  t        j
                  «      t        _        d„ Št        t        d«      rt        j                  ˆfd„«       } y t        j                  j                  ‰«       y )Nc                 ó<  — t         j                  j                  j                  }|j	                  t
        «      €y t        | t        «      ry |j                  }t         j                  j                  | |j                  dddœ¬«      \  }}|j                  ||¬«       y )NÚtrytondF)ÚtypeÚhandled)Úclient_optionsÚ	mechanism)Úhint)Ú
sentry_sdkÚhubÚHubÚcurrentÚget_integrationr   Ú
isinstancer   ÚclientÚutilsÚevent_from_exceptionÚoptionsÚcapture_event)Úer   r   Úeventr   s        r   Úerror_handlerz8TrytondWSGIIntegration.setup_once.<locals>.error_handler   s‹   € Ü—.‘.×$Ñ$×,Ñ,ˆCà×"Ñ"Ô#9Ó:ÐBØÜ˜AœÔ/Øð Ÿ™�Ü(×.Ñ.×CÑCØØ#)§>¡>Ø'0¸UÑCð Dó ‘��tð
 ×!Ñ! %¨dÐ!Õ3r   r&   c                 ó   •—  ‰|«       y r   r   )r   Úrequestr$   r&   s      €r   Ú_z,TrytondWSGIIntegration.setup_once.<locals>._1   s   ø€ á˜aÕ r   )
r   ÚintegrationsÚwsgiÚSentryWsgiMiddlewarer   Úwsgi_appÚhasattrr&   Úerror_handlersÚappend)r)   r&   s    @r   Ú
setup_oncez!TrytondWSGIIntegration.setup_once   sd   ø€ ä!×.Ñ.×3Ñ3×HÑHÌÏÉÓVŒŒò	4ô( ”3˜Ô(ä×Ñó!ó ñ!ô ×Ñ×%Ñ% mÕ4r   N)Ú__name__Ú
__module__Ú__qualname__Ú
identifierr   Ústaticmethodr1   r   r   r   r   r      s    „ Ø€Jòð ñ5ó ñ5r   r   )Úsentry_sdk.hubr   Úsentry_sdk.utilsÚsentry_sdk.integrationsÚsentry_sdk.integrations.wsgiÚsentry_sdk._typesr   Útrytond.exceptionsr   Útrytond.wsgir   Útypingr   r*   ÚIntegrationr   r   r   r   ú<module>r@      s8   ðÛ Û Û Û #Ý +å .Ý áÝô%5˜Z×4Ñ4×@Ñ@õ %5r   