관리-도구
편집 파일: chalice.cpython-37.opt-1.pyc
B T a � @ s* d dl Z d dlmZ d dlmZ d dlmZmZ d dlm Z d dl mZmZ d dl mZ d dlmZ d dlZd d lmZmZ d d lmZ er�d dlmZ d dlmZ d d lmZ d dlmZ ededef d�Zyd dlmZ W n ek r� ed��Y nX G dd� de�Zdd� Z G dd� de�Z!dS )� N)�reraise)�Hub)�Integration�DidNotEnable)�_make_request_event_processor)�capture_internal_exceptions�event_from_exception)�MYPY)�wraps)�Chalice�ChaliceViewError)�EventSourceHandler)�Any)�Dict)�TypeVar)�Callable�F.)Zbound)�__version__zChalice is not installedc @ s e Zd Zdd� ZdS )r c C s� t j}|j}|�� ��}t� � |�� }|�t|||�� W d Q R X yt� | ||�S t k r� t�� }t ||jddd�d�\}}|j||d� |�� t|� Y nX W d Q R X d S )N�chaliceF)�type�handled)�client_options� mechanism)�hint)r �current�client� push_scoper �get_remaining_time_in_millis�add_event_processorr �ChaliceEventSourceHandler�__call__� Exception�sys�exc_infor �options� capture_event�flushr ) �self�event�context�hubr �scope�configured_timer# r � r- �P/opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/integrations/chalice.pyr ! s$ zEventSourceHandler.__call__N)�__name__� __module__�__qualname__r r- r- r- r. r s r c s t ��� �fdd��}|S )Nc s� t j}|j}|�� ��}t� �4 � j�� }� jj|_|� t � j�� � j|�� W d Q R X y �f | �S t k r� } zJt|t�r~� t�� }t||jddd�d�\}}|j||d� |�� � W d d }~X Y nX W d Q R X d S )Nr F)r r )r r )r )r r r r r Zlambda_contextr Z function_nameZtransactionr r Zcurrent_requestZto_dictr! � isinstancer r"