관리-도구
편집 파일: sanic.cpython-38.pyc
U ��\� � @ s� d dl Z d dlZd dlmZ d dlmZmZ d dlmZ d dl m Z mZmZ d dl mZ d dlmZmZ d dlmZ d d lmZmZ d d lmZ d dlmZ d dlmZ G d d� de�Z&dd� Z'dd� Z(G dd� de�Z)dS )� N)�isawaitable)�urlparse�reraise)�Hub)�capture_internal_exceptions�event_from_exception�HAS_REAL_CONTEXTVARS)�Integration)�RequestExtractor�_filter_headers)� ignore_logger)�Sanic�__version__)�SanicException)�Router)�ErrorHandlerc @ s e Zd ZdZedd� �ZdS )�SanicIntegration�sanicc sj t std��t�d�rtd� tj��fdd�} | t_tj��fdd�}|t_t j � � fdd �}|t _ d S ) NzPThe sanic integration for Sentry requires Python 3.7+ or aiocontextvars packagez0.8.�rootc � s� t j}|�t�d kr&� | |f|�|�S t�|�}t |��`}|�� �}|�� |�t |�� W 5 Q R X � | |f|�|�}t |�r�|I d H }|W 5 Q R � S Q R X d S �N)r �current�get_integrationr �weakref�ref�configure_scopeZclear_breadcrumbsZadd_event_processor�_make_request_processorr )�self�request�args�kwargs�hub�weak_request�scope�response)�old_handle_request� �N/opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations/sanic.py�sentry_handle_request= s z:SanicIntegration.setup_once.<locals>.sentry_handle_requestc sT � | |�}t j}|�t�d k rPt� �& |�� �}|d j|_W 5 Q R X W 5 Q R X |S �Nr )r r r r r r �__name__Ztransaction)r r �rvr r"