:M d Z ddlmZ ddlmZ ddlmZ ddlmZm Z ddl m Z ddlm Z G d d e Z G d de ZdS ) z raven.contrib.tornado ~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details :license: BSD, see LICENSE for more details )absolute_import)partial)ioloop)AsyncHTTPClient HTTPError)r )Clientc F e Zd ZdZ fdZd Zd dZd dZd Zd dZ xZ S ) AsyncSentryClientz A mixin class that could be used along with request handlers to asynchronously send errors to sentry. The client also captures the information from the request handlers c ~ | dd | _ t t | j |i | d S )N validate_certT)popr superr __init__)selfargskwargs __class__s p/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/raven/contrib/tornado/__init__.pyr zAsyncSentryClient.__init__ sB #ZZ>>/&&/@@@@@@ c | sdS | j |i |} | j dd| dd i|}|d |fS )a Takes the same arguments as the super function in :py:class:`Client` and extracts the keyword argument callback which will be called on asynchronous sending of the request :return: a 32-length string identifying this event Ncallbackevent_id ) is_enabled build_msgsendget)r r r datafutures r capturezAsyncSentryClient.capture sk Ft~t.v..IIFJJz4$@$@IDIIZ &))r Nc \ | | }| ||| S )zV Serializes the message and passes the payload onto ``send_encoded``. )auth_headerr )encodesend_encoded)r r" r r messages r r zAsyncSentryClient.send/ s0 ++d## kH UUUr c V |i }| j s,| | }| | d S | |||| }t j |t | j || |S )N)urlr headersr )state should_trydecode_log_failed_submission_send_remoter IOLoopcurrent add_futurer _handle_result)r r' r r( r r s r send_remotezAsyncSentryClient.send_remote7 s ?Gz$$&&