<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>

Yc           @@  sL   d  Z  d d l m Z d d l Z d d l m Z d e f d     YZ d S(   s   
raven.contrib.zerorpc
~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
i    (   t   absolute_importN(   t   Clientt   SentryMiddlewarec           B@  s&   e  Z d  Z e d d  Z d   Z RS(   sl  Sentry/Raven middleware for ZeroRPC.

    >>> import zerorpc
    >>> from raven.contrib.zerorpc import SentryMiddleware
    >>> sentry = SentryMiddleware(dsn='udp://..../')
    >>> zerorpc.Context.get_instance().register_middleware(sentry)

    Exceptions detected server-side in ZeroRPC will be submitted to Sentry (and
    propagated to the client as well).
    c         K@  s"   | p t  |   |  _ | |  _ d S(   s  
        Create a middleware object that can be injected in a ZeroRPC server.

        - hide_zerorpc_frames: modify the exception stacktrace to remove the
                               internal zerorpc frames (True by default to make
                               the stacktrace as readable as possible);
        - client: use an existing raven.Client object, otherwise one will be
                  instantiated from the keyword arguments.
        N(   R   t   _sentry_clientt   _hide_zerorpc_frames(   t   selft   hide_zerorpc_framest   clientt   kwargs(    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyt   __init__   s    
c         C@  s   |  j  rs | d } x] | ro | j } t | j d <t j |  } | j d k s_ | j d k rc Pn  | j } q Wn  |  j j	 | d | d S(   sU   
        Called when an exception has been raised in the code run by ZeroRPC
        i   t   __traceback_hide__t   __call__t	   _receivert   extraN(
   R   t   tb_framet   Truet   f_localst   inspectt   getframeinfot   functiont   tb_nextR   t   captureException(   R   t	   req_eventt	   rep_eventt   task_ctxt   exc_infot	   tracebackt   zerorpc_framet
   frame_info(    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyt   server_inspect_exception(   s    	
			N(   t   __name__t
   __module__t   __doc__R   t   NoneR	   R   (    (    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyR      s   
(   R    t
   __future__R    R   t
   raven.baseR   t   objectR   (    (    (    sO   /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/zerorpc/__init__.pyt   <module>   s   