File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 2727
2828ERROR_LOG_LINE_TERMINATE = "\r "
2929ERROR_LOG_IDENT = "\u00a0 " # NO-BREAK SPACE U+00A0
30+ _AWS_LAMBDA_EXCEPTION_WARNING_DISABLE = bool (os .environ .get ("AWS_LAMBDA_EXCEPTION_WARNING_DISABLE" ))
3031_AWS_LAMBDA_LOG_FORMAT = LogFormat .from_str (os .environ .get ("AWS_LAMBDA_LOG_FORMAT" ))
3132_AWS_LAMBDA_LOG_LEVEL = _get_log_level_from_env_var (
3233 os .environ .get ("AWS_LAMBDA_LOG_LEVEL" )
3334)
3435
35-
3636def _get_handler (handler ):
3737 try :
3838 (modname , fname ) = handler .rsplit ("." , 1 )
@@ -212,9 +212,11 @@ def handle_event_request(
212212 )
213213
214214 if error_result is not None :
215- from .lambda_literals import lambda_unhandled_exception_warning_message
215+ if not _AWS_LAMBDA_EXCEPTION_WARNING_DISABLE :
216+ from .lambda_literals import lambda_unhandled_exception_warning_message
217+
218+ log_sink .log (lambda_unhandled_exception_warning_message , _WARNING_FRAME_TYPE )
216219
217- log_sink .log (lambda_unhandled_exception_warning_message , _WARNING_FRAME_TYPE )
218220 log_error (error_result , log_sink )
219221 lambda_runtime_client .post_invocation_error (
220222 invoke_id , to_json (error_result ), to_json (xray_fault )
You can’t perform that action at this time.
0 commit comments