U 췀gh @sddlZddlZddlmZmZddlmZddlmZerddlm Z ddlm Z ddlm Z ddlm Z dd l mZe e eee ege fZGd d d eZd d ZdddZdS)N)capture_internal_exceptionsevent_from_exception) Integration) TYPE_CHECKING)Callable)Any)Type)Optional) TracebackTypec@s*eZdZdZdZdddZeddZdS) ExcepthookIntegration excepthookFcCs"t|tstd|f||_dS)Nz7Invalid value for always_run: %s (must be type boolean)) isinstancebool ValueError always_run)selfrrP/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/integrations/excepthook.py__init__s zExcepthookIntegration.__init__cCsttjt_dS)N)_make_excepthooksysr rrrr setup_once)sz ExcepthookIntegration.setup_onceN)F)__name__ __module__ __qualname__ identifierrr staticmethodrrrrrr s  r csfdd}|S)Nc s|tt}|dkr"|||St|jrpt8t|||ftjdddd\}}tj ||dW5QRX|||S)Nr F)typeZhandled)Zclient_optionsZ mechanism)hint) sentry_sdkZ get_clientZget_integrationr _should_sendrrroptionsZ capture_event)type_value tracebackZ integrationeventrold_excepthookrrsentry_sdk_excepthook1s   z/_make_excepthook..sentry_sdk_excepthookr)r'r(rr&rr/s rFcCs|rdSttdrdSdS)NTps1F)hasattrr)rrrrr Is  r )F)rrZsentry_sdk.utilsrrZsentry_sdk.integrationsrtypingrrrrr typesr BaseExceptionZ Excepthookr rr rrrrs$