Edit File: trytond.cpython-37.opt-1.pyc
B Z~�_� � @ sl d dl Zd dlZd dlZd dlZd dlmZ d dlmZ d dl m Z erTd dlmZ G dd� dej j�ZdS )� N)�MYPY)�TrytonException)�app)�Anyc @ s$ e Zd ZdZdd� Zedd� �ZdS )�TrytondWSGIIntegrationZtrytond_wsgic C s d S )N� )�selfr r �P/opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/integrations/trytond.py�__init__ s zTrytondWSGIIntegration.__init__c sH t jj�tj�t_dd� � ttd�r8tj� fdd��} ntj� � � d S )Nc S s` t jjj}|�t�d krd S t| t�r*d S |j}t j j | |jddd�d�\}}|j||d� d S )NZtrytondF)�typeZhandled)Zclient_optionsZ mechanism)�hint) � sentry_sdk�hubZHub�currentZget_integrationr � isinstancer �clientZutilsZevent_from_exception�optionsZ capture_event)�er r �eventr r r r � error_handler s z8TrytondWSGIIntegration.setup_once.<locals>.error_handlerr c s � |� d S )Nr )r Zrequestr )r r r �_2 s z,TrytondWSGIIntegration.setup_once.<locals>._) r �integrationsZwsgiZSentryWsgiMiddlewarer Zwsgi_app�hasattrr Zerror_handlers�append)r r )r r � setup_once s z!TrytondWSGIIntegration.setup_onceN)�__name__� __module__�__qualname__Z identifierr �staticmethodr r r r r r s r )Zsentry_sdk.hubr Zsentry_sdk.utilsZsentry_sdk.integrationsZsentry_sdk.integrations.wsgiZsentry_sdk._typesr Ztrytond.exceptionsr Ztrytond.wsgir �typingr r ZIntegrationr r r r r �<module> s