/opt/imunify360/venv/lib/python3.11/site-packages/sentry_sdk/integrations
NameSizeModeActions
django/-0755rm
spark/-0755rm
__pycache__/-0755rm
aiohttp.py79600644editdlrm
argv.py9450644editdlrm
asgi.py83680644editdlrm
atexit.py18370644editdlrm
aws_lambda.py129410644editdlrm
beam.py56620644editdlrm
boto3.py37270644editdlrm
bottle.py61870644editdlrm
celery.py91190644editdlrm
chalice.py45730644editdlrm
dedupe.py11660644editdlrm
excepthook.py21900644editdlrm
executing.py20230644editdlrm
falcon.py67960644editdlrm
flask.py74280644editdlrm
gcp.py73820644editdlrm
gnu_backtrace.py29120644editdlrm
logging.py75730644editdlrm
modules.py13930644editdlrm
pure_eval.py45200644editdlrm
pyramid.py70720644editdlrm
redis.py30750644editdlrm
rq.py47910644editdlrm
sanic.py77090644editdlrm
serverless.py19710644editdlrm
sqlalchemy.py29390644editdlrm
stdlib.py73480644editdlrm
threading.py28560644editdlrm
tornado.py70010644editdlrm
trytond.py17280644editdlrm
wsgi.py103740644editdlrm
_wsgi_common.py47630644editdlrm
__init__.py65090644editdlrm
Edit: /opt/imunify360/venv/lib/python3.11/site-packages/sentry_sdk/integrations/trytond.py (1728B)
import sentry_sdk.hub import sentry_sdk.utils import sentry_sdk.integrations import sentry_sdk.integrations.wsgi from sentry_sdk._types import MYPY from trytond.exceptions import TrytonException # type: ignore from trytond.wsgi import app # type: ignore if MYPY: from typing import Any # TODO: trytond-worker, trytond-cron and trytond-admin intergations class TrytondWSGIIntegration(sentry_sdk.integrations.Integration): identifier = "trytond_wsgi" def __init__(self): # type: () -> None pass @staticmethod def setup_once(): # type: () -> None app.wsgi_app = sentry_sdk.integrations.wsgi.SentryWsgiMiddleware(app.wsgi_app) def error_handler(e): # type: (Exception) -> None hub = sentry_sdk.hub.Hub.current if hub.get_integration(TrytondWSGIIntegration) is None: return elif isinstance(e, TrytonException): return else: # If an integration is there, a client has to be there. client = hub.client # type: Any event, hint = sentry_sdk.utils.event_from_exception( e, client_options=client.options, mechanism={"type": "trytond", "handled": False}, ) hub.capture_event(event, hint=hint) # Expected error handlers signature was changed # when the error_handler decorator was introduced # in Tryton-5.4 if hasattr(app, "error_handler"): @app.error_handler def _(app, request, e): # type: ignore error_handler(e) else: app.error_handlers.append(error_handler)