관리-도구
편집 파일: trytond.cpython-38.pyc
U �Mgs � @ s\ d dl Z d dlmZ d dlmZ d dlmZmZ d dlm Z d dl mZ G dd� de�ZdS ) � N)�Integration)�SentryWsgiMiddleware)�ensure_integration_enabled�event_from_exception)�TrytonException)�appc @ s. e Zd ZdZde� �Zdd� Zedd� �ZdS )�TrytondWSGIIntegrationZtrytond_wsgiz auto.http.c C s d S �N� )�selfr r �M/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/integrations/trytond.py�__init__ s zTrytondWSGIIntegration.__init__c sP t tjtjd�t_tt�dd� �� ttd�r@tj� fdd��} ntj� � � d S )N)Zspan_originc S sB t | t�rd S t�� }t| |jddd�d�\}}tj||d� d S )NZtrytondF)�typeZhandled)Zclient_optionsZ mechanism)�hint)� isinstancer � sentry_sdkZ get_clientr �optionsZ capture_event)�e�client�eventr r r r � error_handler s � z8TrytondWSGIIntegration.setup_once.<locals>.error_handlerr c s � |� d S r r )r �requestr �r r r �_- s z,TrytondWSGIIntegration.setup_once.<locals>._) r r Zwsgi_appr �originr �hasattrr Zerror_handlers�append)r r r r � setup_once s � z!TrytondWSGIIntegration.setup_onceN)�__name__� __module__�__qualname__� identifierr r �staticmethodr r r r r r s r ) r Zsentry_sdk.integrationsr Zsentry_sdk.integrations.wsgir Zsentry_sdk.utilsr r Ztrytond.exceptionsr Ztrytond.wsgir r r r r r �<module> s