AlkantarClanX12
Current Path : /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/tornado/ |
Current File : //opt/alt/python27/lib/python2.7/site-packages/raven/contrib/tornado/__init__.pyc |
� ��Yc @@ s� d Z d d l m Z d d l m Z d d l m Z d d l m Z m Z d d l m Z d d l m Z d e f d � � YZ d e f d � � YZ d S( s� raven.contrib.tornado ~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details :license: BSD, see LICENSE for more details i ( t absolute_import( t partial( t ioloop( t AsyncHTTPClientt HTTPError( R ( t Clientt AsyncSentryClientc B@ sV e Z d Z d � Z d � Z d d d � Z d d d � Z d � Z d d d � Z RS( s� 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 O@ s2 | j d t � | _ t t | � j | | � d S( Nt validate_cert( t popt TrueR t superR t __init__( t selft argst kwargs( ( sO /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/tornado/__init__.pyR s c O@ sQ | j � s d S| j | | � } | j d | j d d � | � } | d | f S( s 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 Nt callbackt event_id( t is_enabledt build_msgt sendt gett None( R R R t datat future( ( sO /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/tornado/__init__.pyt capture s !c K@ s( | j | � } | j | d | d | �S( sV Serializes the message and passes the payload onto ``send_encoded``. t auth_headerR ( t encodet send_encoded( R R R R t message( ( sO /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/tornado/__init__.pyR / s c C@ s� | d k r i } n | j j � sD | j | � } | j | � d S| j d | d | d | d | � } t j j � j | t | j | | � � | S( Nt urlR t headersR ( R t statet should_tryt decodet _log_failed_submissiont _send_remoteR t IOLoopt currentt add_futureR t _handle_result( R R R R R R ( ( sO /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/tornado/__init__.pyt send_remote7 s (c C@ s� y | j � Wni t k rE } | j | � } | j | | | � nB t k ry } | j | � } | j | | | � n X| j j � d S( N( t resultR R! t _failed_sendt ExceptionR t set_success( R R R R t e( ( sO /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/tornado/__init__.pyR'