bg dZddlmZddlmZddlmZmZddlm Z m Z m Z edZ GddeZ Gd d eZd S) z raven.middleware ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. )absolute_import)contextmanager)Iteratornext)get_current_url get_headers get_environc#K dVdS#ttf$rt$r||t$r||t $r&}|jdkr||d}~wwxYw)Nr) StopIteration GeneratorExit Exceptionhandle_exceptionKeyboardInterrupt SystemExitcode)environclientes a/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/raven/middleware.pycommon_exception_handlingrs  = )  ((( (((  6Q;;  # #G , , , s AB #!BB c*eZdZdZdZdZdZdZdS)ClosingIteratorz[ An iterator that is implements a ``close`` method as-per WSGI recommendation. c||_||_t|dd|_t ||_d|_dS)NcloseF)sentryrgetattr_closeiteriterableclosed)selfrrrs r__init__zClosingIterator.__init__,s;  h66 X  c|SNr!s r__iter__zClosingIterator.__iter__3s r#c t|j|j5t|jcdddS#1swxYwYdS#t $r|wxYwr%)rrrrrr rr's r__next__zClosingIterator.__next__6s *4<EE + +DM** + + + + + + + + + + + + + + + + + +    JJLLL   s+A = A AA AA A*c|jrdS |jFt|j|j5|dddn #1swxYwY|jjj|jjjd|_dS#|jjj|jjjd|_wxYw)NT) r rrrrrcontextclear transactionr's rrzClosingIterator.closeBs ;  F {&.t|T[II""KKMMM""""""""""""""" K  & , , . . . K  * 0 0 2 2 2DKKK K  & , , . . . K  * 0 0 2 2 2DK    s/!B'A  B' AB'AB''AC6N)__name__ __module__ __qualname____doc__r"r(r*rr&r#rrr&sZ         r#rc.eZdZdZddZdZdZddZdS)Sentryz A WSGI middleware which will attempt to capture any uncaught exceptions and send them to Sentry. >>> from raven.base import Client >>> application = Sentry(application, Client()) NcF||_|ddlm}|}||_dS)Nr)Client) application raven.baser6r)r!r7rr6s rr"zSentry.__init__Xs7& > ) ) ) ) ) )VXXF r#c|j||t||5|||}dddn #1swxYwYt |||Sr%)r http_contextget_http_contextrr7r)r!rstart_responsers r__call__zSentry.__call___s   !6!6w!?!?@@@ &w 5 5 A A''@@H A A A A A A A A A A A A A A AtXw777sA!!A%(A%c |dt|d|dtt|tt |dS)NREQUEST_METHODT)strip_querystring QUERY_STRING)methodurl query_stringheadersenv)getrdictrr r!rs rr;zSentry.get_http_contextgshkk"233"7dCCC#KK77K0011 G,,--   r#c4|jSr%)rcaptureExceptionrIs rrzSentry.handle_exceptionrs{++---r#r%)r/r0r1r2r"r=r;rr&r#rr4r4Osd888    ......r#r4N)r2 __future__r contextlibrraven.utils.compatrrraven.utils.wsgirrr rrobjectr4r&r#rrQs'&&&&&%%%%%%--------//////////(&&&&&h&&&R$.$.$.$.$.V$.$.$.$.$.r#