Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias identifier ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults vararg kwarg body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr body Return Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Str NameLoad NameLoad Return TupleLoad SubscriptLoad NameLoad Index Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Dict If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body TryExcept body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad ExceptHandler type NameLoad name NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Dict Return Call AttributeLoad Call NameLoad attr NameLoad NameLoad keyword Str keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Dict Str Dict Str Str Str Str Str Str Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str NameLoad Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Return Dict Return Dict Str Dict Str IfExp NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Dict Str Dict decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Dict Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Return Call Call NameLoad NameLoad NameLoad keyword NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad kwarg body Return Call AttributeLoad NameLoad attr Str keyword NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults kwarg body Return Call AttributeLoad NameLoad attr Str keyword NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad If BoolOpAnd Call NameLoad NameLoad NameLoad BoolOpOr CompareLt AttributeLoad NameLoad attr Num CompareGt AttributeLoad NameLoad attr Num body Return NameLoad Expr Call AttributeLoad NameLoad attr keyword TupleLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num kwarg body Expr Str If Call NameLoad Call NameLoad NameLoad NameLoad Str body Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad If CompareLtELtE Num NameLoad Num body Expr Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Str Return NameLoad decorator_list decorator_list
N/A N/A 
raven.contrib.tornado
~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details
:license: BSD, see LICENSE for more details
 __future__ absolute_import functools partial tornado ioloop tornado.httpclient AsyncHTTPClient HTTPError tornado.web HTTPError WebHTTPError raven.base Client AsyncSentryClient N/A Client N/A N/A 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
     __init__ N/A N/A self N/A args kwargs N/A N/A N/A self validate_cert N/A N/A kwargs pop validate_cert True N/A N/A N/A N/A super AsyncSentryClient self __init__ args kwargs N/A capture N/A N/A self N/A args kwargs N/A N/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
         N/A N/A N/A N/A self is_enabled N/A N/A N/A data N/A N/A self build_msg args kwargs N/A future N/A N/A self send callback N/A N/A kwargs get callback None data N/A N/A N/A data N/A event_id future N/A send N/A N/A self auth_header callback N/A None None data N/A N/A 
        Serializes the message and passes the payload onto ``send_encoded``.
         N/A message N/A N/A self encode data N/A N/A N/A self send_encoded message auth_header auth_header callback callback N/A send_remote N/A N/A self url data headers callback N/A None None N/A N/A N/A headers None N/A N/A headers N/A N/A N/A N/A N/A N/A self state should_try N/A N/A data N/A N/A self decode data N/A N/A N/A self _log_failed_submission data N/A N/A future N/A N/A self _send_remote url url data data headers headers callback callback N/A N/A N/A N/A N/A N/A ioloop IOLoop current add_future future N/A partial N/A self _handle_result url data N/A future N/A _handle_result N/A N/A self url data future N/A N/A N/A N/A N/A N/A N/A future result N/A N/A N/A HTTPError N/A e N/A N/A data N/A N/A self decode data N/A N/A N/A self _failed_send e url data N/A N/A Exception N/A e N/A N/A data N/A N/A self decode data N/A N/A N/A self _failed_send e url data N/A N/A N/A N/A N/A self state set_success N/A _send_remote N/A N/A self url data headers callback N/A None None N/A N/A 
        Initialise a Tornado AsyncClient and send the reuqest to the sentry
        server. If the callback is a callable, it will be called with the
        response.
         N/A N/A headers None N/A N/A headers N/A N/A N/A N/A N/A AsyncHTTPClient fetch url callback method POST body data headers headers validate_cert N/A self validate_cert N/A N/A SentryMixin N/A object N/A N/A 
    A mixin class that extracts information from the Request in a Request
    Handler to capture and send to sentry. This mixin class is designed to be
    used along with `tornado.web.RequestHandler`

    .. code-block:: python
        :emphasize-lines: 6

        class MyRequestHandler(SentryMixin, tornado.web.RequestHandler):
            def get(self):
                try:
                    fail()
                except Exception as e:
                    self.captureException()


    While the above example would result in sequential execution, an example
    for asynchronous use would be

    .. code-block:: python
        :emphasize-lines: 6

        class MyRequestHandler(SentryMixin, tornado.web.RequestHandler):

            @tornado.web.asynchronous
            @tornado.gen.engine
            def get(self):
                # Do something and record a message in sentry
                response = yield tornado.gen.Task(
                    self.captureMessage, "Did something really important"
                )
                self.write("Your request to do something important is done")
                self.finish()


    The mixin assumes that the application will have an attribute called
    `sentry_client`, which should be an instance of
    :py:class:`AsyncSentryClient`. This can be changed by implementing your
    own get_sentry_client method on your request handler.
     get_sentry_client N/A N/A self N/A N/A N/A 
        Returns the sentry client configured in the application. If you need
        to change the behaviour to do something else to get the client, then
        subclass this method
         N/A N/A N/A self application sentry_client N/A get_sentry_data_from_request N/A N/A self N/A N/A N/A 
        Extracts the data required for 'sentry.interfaces.Http' from the
        current request being handled by the request handler

        :param return: A dictionary.
         N/A N/A request N/A url method data query_string cookies headers N/A N/A N/A self request full_url N/A N/A self request method N/A N/A self request body N/A N/A self request query N/A N/A N/A N/A self request headers get Cookie None N/A dict N/A N/A self request headers N/A get_sentry_user_info N/A N/A self N/A N/A N/A 
        Data for sentry.interfaces.User

        Default implementation only sends `is_authenticated` by checking if
        `tornado.web.RequestHandler.get_current_user` tests postitively for on
        Truth calue testing
         N/A N/A N/A user N/A N/A self get_current_user N/A N/A N/A Exception N/A N/A N/A N/A N/A user N/A is_authenticated N/A user True False N/A get_sentry_extra_info N/A N/A self N/A N/A N/A 
        Subclass and implement this method if you need to send any extra
        information
         N/A N/A extra N/A N/A get_default_context N/A N/A self N/A N/A N/A data N/A N/A N/A N/A data update N/A N/A self get_sentry_data_from_request N/A N/A N/A data update N/A N/A self get_sentry_user_info N/A N/A N/A data update N/A N/A self get_sentry_extra_info N/A data N/A _capture N/A N/A self call_name data N/A None kwargs N/A N/A N/A data None N/A N/A data N/A N/A self get_default_context N/A N/A default_context N/A N/A self get_default_context N/A N/A isinstance data dict N/A N/A N/A N/A default_context update data N/A N/A N/A N/A default_context N/A extra N/A extra_data data N/A data default_context N/A client N/A N/A self get_sentry_client N/A N/A N/A getattr client call_name data data kwargs N/A captureException N/A N/A self exc_info N/A None kwargs N/A N/A N/A N/A self _capture captureException exc_info exc_info kwargs N/A captureMessage N/A N/A self message N/A kwargs N/A N/A N/A N/A self _capture captureMessage message message kwargs N/A log_exception N/A N/A self typ value tb N/A N/A N/A Override implementation to report all exceptions to sentry.
        log_exception() is added in Tornado v3.1.
         N/A rv N/A N/A N/A super SentryMixin self log_exception typ value tb N/A N/A N/A isinstance value WebHTTPError N/A N/A N/A value status_code 500 N/A N/A value status_code 599 N/A N/A rv N/A N/A N/A self captureException exc_info N/A typ value tb N/A rv N/A send_error N/A N/A self status_code N/A 500 kwargs N/A N/A Override implementation to report all exceptions to sentry, even
        after self.flush() or self.finish() is called, for pre-v3.1 Tornado.
         N/A N/A hasattr N/A super SentryMixin self log_exception N/A N/A N/A N/A N/A super SentryMixin self send_error status_code kwargs N/A N/A rv N/A N/A N/A super SentryMixin self send_error status_code kwargs N/A N/A 500 status_code 599 N/A N/A N/A N/A self captureException exc_info N/A N/A kwargs get exc_info N/A rv N/A N/A