<!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>
B
    YR
                 @   s8   d Z ddlmZ ddlZddlmZ G dd deZdS )z
raven.contrib.zerorpc
~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
    )absolute_importN)Clientc               @   s"   e Zd ZdZdddZdd ZdS )	SentryMiddlewareal  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).
    TNc             K   s   |pt f || _|| _dS )a  
        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   _sentry_client_hide_zerorpc_frames)selfZhide_zerorpc_framesZclientkwargs r	   O/opt/alt/python37/lib/python3.7/site-packages/raven/contrib/zerorpc/__init__.py__init__   s    
zSentryMiddleware.__init__c             C   sb   | j rN|d }x>|rL|j}d|jd< t|}|jdksB|jdkrDP |j}qW | jj||d dS )zU
        Called when an exception has been raised in the code run by ZeroRPC
           TZ__traceback_hide____call__Z	_receiver)extraN)	r   tb_framef_localsinspectgetframeinfofunctiontb_nextr   ZcaptureException)r   Z	req_eventZ	rep_eventZtask_ctxexc_info	tracebackZzerorpc_frameZ
frame_infor	   r	   r
   server_inspect_exception(   s    




z)SentryMiddleware.server_inspect_exception)TN)__name__
__module____qualname____doc__r   r   r	   r	   r	   r
   r      s   

r   )r   
__future__r   r   Z
raven.baser   objectr   r	   r	   r	   r
   <module>   s   