$79 GRAYBYTE WORDPRESS FILE MANAGER $17

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/integrations/

HOME
Current File : /opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/integrations//excepthook.py
import sys

from sentry_sdk.hub import Hub
from sentry_sdk.utils import capture_internal_exceptions, event_from_exception
from sentry_sdk.integrations import Integration

from sentry_sdk._types import MYPY

if MYPY:
    from typing import Callable
    from typing import Any
    from typing import Type

    from types import TracebackType

    Excepthook = Callable[
        [Type[BaseException], BaseException, TracebackType],
        Any,
    ]


class ExcepthookIntegration(Integration):
    identifier = "excepthook"

    always_run = False

    def __init__(self, always_run=False):
        # type: (bool) -> None

        if not isinstance(always_run, bool):
            raise ValueError(
                "Invalid value for always_run: %s (must be type boolean)"
                % (always_run,)
            )
        self.always_run = always_run

    @staticmethod
    def setup_once():
        # type: () -> None
        sys.excepthook = _make_excepthook(sys.excepthook)


def _make_excepthook(old_excepthook):
    # type: (Excepthook) -> Excepthook
    def sentry_sdk_excepthook(type_, value, traceback):
        # type: (Type[BaseException], BaseException, TracebackType) -> None
        hub = Hub.current
        integration = hub.get_integration(ExcepthookIntegration)

        if integration is not None and _should_send(integration.always_run):
            # If an integration is there, a client has to be there.
            client = hub.client  # type: Any

            with capture_internal_exceptions():
                event, hint = event_from_exception(
                    (type_, value, traceback),
                    client_options=client.options,
                    mechanism={"type": "excepthook", "handled": False},
                )
                hub.capture_event(event, hint=hint)

        return old_excepthook(type_, value, traceback)

    return sentry_sdk_excepthook


def _should_send(always_run=False):
    # type: (bool) -> bool
    if always_run:
        return True

    if hasattr(sys, "ps1"):
        # Disable the excepthook for interactive Python shells, otherwise
        # every typo gets sent to Sentry.
        return False

    return True

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 6.48 AM
root / 996
0755
__pycache__
--
31 Aug 2024 6.48 AM
root / 996
0755
django
--
31 Aug 2024 6.48 AM
root / 996
0755
spark
--
31 Aug 2024 6.48 AM
root / 996
0755
__init__.py
6.356 KB
27 Jul 2021 9.04 PM
root / 996
0644
_wsgi_common.py
4.651 KB
27 Jul 2021 9.04 PM
root / 996
0644
aiohttp.py
7.766 KB
27 Jul 2021 9.04 PM
root / 996
0644
argv.py
0.923 KB
27 Jul 2021 9.04 PM
root / 996
0644
asgi.py
8.257 KB
27 Jul 2021 9.04 PM
root / 996
0644
atexit.py
1.794 KB
27 Jul 2021 9.04 PM
root / 996
0644
aws_lambda.py
14.987 KB
27 Jul 2021 9.04 PM
root / 996
0644
beam.py
5.529 KB
27 Jul 2021 9.04 PM
root / 996
0644
boto3.py
4.048 KB
27 Jul 2021 9.04 PM
root / 996
0644
bottle.py
6.062 KB
27 Jul 2021 9.04 PM
root / 996
0644
celery.py
9.312 KB
27 Jul 2021 9.04 PM
root / 996
0644
chalice.py
4.502 KB
27 Jul 2021 9.04 PM
root / 996
0644
dedupe.py
1.139 KB
27 Jul 2021 9.04 PM
root / 996
0644
excepthook.py
2.139 KB
27 Jul 2021 9.04 PM
root / 996
0644
executing.py
1.976 KB
27 Jul 2021 9.04 PM
root / 996
0644
falcon.py
6.637 KB
27 Jul 2021 9.04 PM
root / 996
0644
flask.py
7.296 KB
27 Jul 2021 9.04 PM
root / 996
0644
gcp.py
7.842 KB
27 Jul 2021 9.04 PM
root / 996
0644
gnu_backtrace.py
2.844 KB
27 Jul 2021 9.04 PM
root / 996
0644
httpx.py
2.552 KB
27 Jul 2021 9.04 PM
root / 996
0644
logging.py
7.543 KB
27 Jul 2021 9.04 PM
root / 996
0644
modules.py
1.36 KB
27 Jul 2021 9.04 PM
root / 996
0644
pure_eval.py
4.414 KB
27 Jul 2021 9.04 PM
root / 996
0644
pyramid.py
6.906 KB
27 Jul 2021 9.04 PM
root / 996
0644
redis.py
3.004 KB
27 Jul 2021 9.04 PM
root / 996
0644
rq.py
4.838 KB
27 Jul 2021 9.04 PM
root / 996
0644
sanic.py
8.444 KB
27 Jul 2021 9.04 PM
root / 996
0644
serverless.py
1.925 KB
27 Jul 2021 9.04 PM
root / 996
0644
sqlalchemy.py
2.87 KB
27 Jul 2021 9.04 PM
root / 996
0644
stdlib.py
7.245 KB
27 Jul 2021 9.04 PM
root / 996
0644
threading.py
2.789 KB
27 Jul 2021 9.04 PM
root / 996
0644
tornado.py
7.018 KB
27 Jul 2021 9.04 PM
root / 996
0644
trytond.py
1.688 KB
27 Jul 2021 9.04 PM
root / 996
0644
wsgi.py
10.888 KB
27 Jul 2021 9.04 PM
root / 996
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF