<!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
    Y
                 @   s\   d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ G dd	 d	eZdS )
z
raven.contrib.bottle
~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
    )absolute_importN)request)setup_logging)get_data_from_request)SentryHandlerc               @   s:   e Zd ZdZdddZdd Zdd Zd	d
 Zdd ZdS )Sentryav  
    Bottle application for Sentry.

    >>> sentry = Sentry(app, client)

    Automatically configure logging::

    >>> sentry = Sentry(app, client, logging=True)

    Capture an exception::

    >>> try:
    >>>     1 / 0
    >>> except ZeroDivisionError:
    >>>     sentry.captureException()

    Capture a message::

    >>> sentry.captureMessage('hello, world!')
    Fc             C   s2   || _ || _|| _| jr&tt| j | | j _d S )N)appclientloggingr   r   Zsentry)selfr   r	   r
    r   N/opt/alt/python37/lib/python3.7/site-packages/raven/contrib/bottle/__init__.py__init__)   s    zSentry.__init__c             O   s&   | j j|dttd| jid d S )Nexc_infor   )r   dataextra)r	   captureExceptiongetr   r   r   )r   argskwargsr   r   r   handle_exception1   s    zSentry.handle_exceptionc                sH   d fdd	}y  ||S  tk
rB    jt d  Y nX d S )Nc                s    |d k	r j |d | ||S )N)r   )r   )statusheadersr   )r   start_responser   r   session_start_response;   s    z/Sentry.__call__.<locals>.session_start_response)r   )N)r   	Exceptionr   sysr   )r   environr   r   r   )r   r   r   __call__:   s    zSentry.__call__c             O   sT   | j std|d}|d krFytt|d< W n tk
rD   Y nX | j j||S )Nz5captureException called before application configuredr   )r	   AssertionErrorr   r   r   RuntimeErrorr   )r   r   r   r   r   r   r   r   H   s    
zSentry.captureExceptionc             O   sT   | j std|d}|d krFytt|d< W n tk
rD   Y nX | j j||S )Nz3captureMessage called before application configuredr   )r	   r   r   r   r   r    captureMessage)r   r   r   r   r   r   r   r!   S   s    
zSentry.captureMessageN)F)	__name__
__module____qualname____doc__r   r   r   r   r!   r   r   r   r   r      s   
	r   )r%   
__future__r   r   bottler   Z
raven.confr   Zraven.contrib.bottle.utilsr   Zraven.handlers.loggingr   objectr   r   r   r   r   <module>   s   