/opt/cloudlinux/venv/lib/python3.11/site-packages/raven/contrib/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/raven/contrib/__pycache__/sanic.cpython-311.pyc (10322B)
§
SQ+´Þ†Yã óÚ — d Z ddlmZ ddlZddlZddlmZ ddlmZ ddl m
Z
ddlmZ ddl
mZ dd lmZ ej ¦ « Ze d
¦ « Zdd„Z G d„ d
e¦ « ZdS )z£
raven.contrib.sanic
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2018 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
é )Úabsolute_importN)Ú
setup_logging)ÚClient)Ú
SentryHandler)Úurlparse)Ú
to_unicode)Úconvert_optionsÚlogging_configuredc ó¾ — | di t |j |t |j dg ¦ « ¦ « t |j g¦ « z d|idœ¬¦ « ¤ŽS )NÚSENTRY_INCLUDE_PATHSÚapp)ÚdsnÚ
include_pathsÚextra)Údefaults© )r ÚconfigÚsetÚgetÚname)Ú
client_clsr
r s úe/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/raven/contrib/sanic.pyÚmake_clientr s~ € ؈:ð ð Ý
ØŒJà嘜
ŸšÐ'=¸rÑBÔBÑCÔCݘ3œ8˜*‘o”oñ&ð ˜3ðð
ð ð
ñ
ô
ðð ð ó c ó� — e Zd ZdZdedddej fd„Zd„ Zd„ Z d„ Z
d„ Zd „ Zd
„ Z
dd„Zd„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚSentryaj
Sanic application for Sentry.
Look up configuration from ``os.environ['SENTRY_DSN']``::
>>> sentry = Sentry(app)
Pass an arbitrary DSN::
>>> sentry = Sentry(app, dsn='http://public:secret@example.com/1')
Pass an explicit client::
>>> sentry = Sentry(app, client=client)
Automatically configure logging::
>>> sentry = Sentry(app, logging=True, level=logging.ERROR)
Capture an exception::
>>> try:
>>> 1 / 0
>>> except ZeroDivisionError:
>>> sentry.captureException()
Capture a message::
>>> sentry.captureMessage('hello, world!')
NFc óÐ — |r$t |t ¦ « st d¦ « ‚|| _ || _ || _ || _ || _ || _ | |¦ « d S )Nz&client should be an instance of Client)
Ú
isinstancer Ú TypeErrorÚclientr r ÚloggingÚlogging_exclusionsÚlevelÚinit_app)Úselfr
r r r r! r" r# s r Ú__init__zSentry.__init__M so € àð F�* VVÑ4Ô4ð FÝÐDÑEÔEÐEàˆŒØ$ˆŒØˆŒØˆŒØ"4ˆÔ؈Œ
�
Š
�cÑÔÐÐÐr c óV — | j sd S | j | |¦ « ¦ « nC# t $ r6}| j j t
|¦ « ¦ « Y d }~nd }~ww xY wt |¦ « ||j f}| |¬¦ « d S )N)Úexc_info)
r Úhttp_contextÚ
get_http_infoÚ ExceptionÚloggerÚ exceptionr ÚtypeÚ
__traceback__ÚcaptureException)r% Úrequestr- ÚeÚexception_infos r Úhandle_exceptionzSentry.handle_exceptionZ s¾ € ØŒ{ð ØˆFð 8ØŒK×$Ò$ T×%7Ò%7¸Ñ%@Ô%@ÑAÔAÐAÐAøÝð 8ð 8ð 8ØŒKÔ×(Ò(°A©¬Ñ7Ô7Ð7Ð7Ð7Ð7Ð7Ð7øøøøð 8øøøõ
˜y™/œ/¨9°iÔ6MÐNˆØ×Ò ~ÐÑ6Ô6Ð6Ð6Ð6s ‹-9 ¹
A9Á,A4Á4A9c ó — |j S ©N)Úform©r% r1 s r Ú
get_form_datazSentry.get_form_datag ó
€ ØŒ|Ðr c óv — | |¦ « r| j }n| j }| ||¦ « S )zR
Determine how to retrieve actual data by using request.mimetype.
)Úis_json_typeÚ
get_json_datar9 Úget_http_info_with_retriever)r% r1 Ú retrievers r r* zSentry.get_http_infoj sB € ð ×Ò˜WÑ%Ô%ð +ØÔ*ˆIˆIàÔ*ˆIØ×0Ò0°¸)ÑDÔDÐDr c ó — |j S r6 )Újsonr8 s r r= zSentry.get_json_datat r: r c ó — t j |j ¦ « } ||¦ « }n# t $ r i }Y nw xY wd |j |j |j ¦ « |j |j ||j
|j d|j idœS )zT
Exact method for getting http_info but with form data work around.
z{0}://{1}{2}ÚREMOTE_ADDR)ÚurlÚquery_stringÚmethodÚdataÚcookiesÚheadersÚenv)
r ÚurlsplitrD r+ ÚformatÚschemeÚnetlocÚpathÚqueryrF rH rI Úremote_addr)r% r1 r? ÚurlpartsrG s r r> z#Sentry.get_http_info_with_retrieverw s§ € õ Ô$ W¤[Ñ1Ô1ˆð Ø�9˜WÑ%Ô%ˆDˆDøÝð ð ð ØˆDˆDˆDð øøøð "×(Ò(Ø” ¤°(´-ñAô Aà$œNØ”nØØ”Ø”à˜wÔ2ðð
ð
ð
s ›' §6µ6c óB — |j d¦ « }|dk S )Nzcontent-typezapplication/json)rI r )r% r1 Úcontent_types r r<