/opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations
NameSizeModeActions
django/-0755rm
__pycache__/-0755rm
aiohttp.py38890644editdlrm
argv.py8940644editdlrm
atexit.py14900644editdlrm
aws_lambda.py67580644editdlrm
bottle.py55270644editdlrm
celery.py44230644editdlrm
dedupe.py10850644editdlrm
excepthook.py13350644editdlrm
flask.py72720644editdlrm
gnu_backtrace.py30080644editdlrm
logging.py60190644editdlrm
modules.py12390644editdlrm
pyramid.py59140644editdlrm
rq.py32730644editdlrm
sanic.py70650644editdlrm
serverless.py12380644editdlrm
stdlib.py18690644editdlrm
threading.py15970644editdlrm
tornado.py63870644editdlrm
wsgi.py72990644editdlrm
_wsgi_common.py36660644editdlrm
__init__.py42360644editdlrm
Edit: /opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations/serverless.py (1238B)
import functools import sys from sentry_sdk.hub import Hub from sentry_sdk.utils import event_from_exception from sentry_sdk._compat import reraise def serverless_function(f=None, flush=True): def wrapper(f): @functools.wraps(f) def inner(*args, **kwargs): with Hub(Hub.current) as hub: with hub.configure_scope() as scope: scope.clear_breadcrumbs() try: return f(*args, **kwargs) except Exception: _capture_and_reraise() finally: if flush: _flush_client() return inner if f is None: return wrapper else: return wrapper(f) def _capture_and_reraise(): exc_info = sys.exc_info() hub = Hub.current if hub is not None and hub.client is not None: event, hint = event_from_exception( exc_info, client_options=hub.client.options, mechanism={"type": "serverless", "handled": False}, ) hub.capture_event(event, hint=hint) reraise(*exc_info) def _flush_client(): hub = Hub.current if hub is not None: hub.flush()