0i[DddlZddlmZddlZddlmZmZddlmZddl m Z ddl m Z m Z mZmZ ddlZddlmZddlmZmZdd lmZdd lmZer'dd lmZdd lmZddlmZddlmZededefZGddeZdZ GddeZ!y#e$r ed wxYw)Nwraps) Integration DidNotEnable)_make_request_event_processor)TransactionSource)capture_internal_exceptionsevent_from_exception parse_versionreraise) __version__)ChaliceChaliceViewError)EventSourceHandlerzChalice is not installed) TYPE_CHECKING)Any)Dict)TypeVar)CallableF.)boundceZdZdZy)rc 8tj}tj5}t5|j }|j t |||ddd tj|||cdddS#1swY*xYw#t$rdtj}t||jddd\}}tj|||jt!|YnwxYw dddy#1swYyxYw)NchaliceFtypehandledclient_options mechanismhint) sentry_sdk get_clientisolation_scoper get_remaining_time_in_millisadd_event_processorrChaliceEventSourceHandler__call__ Exceptionsysexc_infor options capture_eventflushr )selfeventcontextclientscopeconfigured_timer,r"s N/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/chalice.pyr)zEventSourceHandler.__call__#s&&(  ' ' )U,.")"F"F"H))1%/R/ #099$wO* ).. #<<>2#)>>'0UC t ((T: " ###* ) )sA D-B !D*B B DA*DDDDDN)__name__ __module__ __qualname__r)r6rr"s#r;rc2tfd}|S)Nc tj}tj5}t5jj }|j jjtj|jtjjj|ddd  di|cdddS#1swYxYw#t$rp}t|t rt#j$}t'||j(ddd\}}tj*|||j-d}~wwxYw#1swYyxYw)N)sourcerFrrr!r:)r#r$r%r lambda_contextr&set_transaction_name function_namer COMPONENTr'rcurrent_requestto_dictr* isinstancerr+r,r r-r.r/) function_argsr3r4r5excr,r1r"app view_functions r6wrapped_view_functionz:_get_view_function_response..wrapped_view_function=s1&&(  ' ' )U,."%"4"4"Q"Q"S**&&44,66+ ))1++335**'/ $5}5!* )..  c#34<<>2#)>>'0UC t ((T:  #* )sB E%BCE% C)C& "E%) E"2A+EE""E%%E.r)rHrIrFrJs`` r6_get_view_function_responserK;s# =B ! r;c eZdZdZedZy)ChaliceIntegrationrc tt}|tdjt|dkrtj nddlm}|j fd}|dkr |t_n|_ttj_y)NzUnparsable Chalice version: {})r)RestAPIEventHandlerc2t|||}|||S)N)rK)rHrIrFrJold_get_view_function_responses r6sentry_event_responsez.sentry_event_responsews,$?]M% !2*M r;) r CHALICE_VERSIONrformatrrK chalice.apprQrrrH)versionrQrTrSs @r6 setup_oncezChaliceIntegration.setup_oncees~ 0 ??FFWX X W -4-P-P * 7$?? +  W 2GG />S  ;); &r;N)r7r8r9 identifier staticmethodrYr:r;r6rMrMbsJ < rcs =L0361K!8CH-.A#2#2$!N$<$<]3 1 223s BB