File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 27
27
28
28
ERROR_LOG_LINE_TERMINATE = "\r "
29
29
ERROR_LOG_IDENT = "\u00a0 " # NO-BREAK SPACE U+00A0
30
+ _AWS_LAMBDA_EXCEPTION_WARNING_DISABLE = bool (os .environ .get ("AWS_LAMBDA_EXCEPTION_WARNING_DISABLE" ))
30
31
_AWS_LAMBDA_LOG_FORMAT = LogFormat .from_str (os .environ .get ("AWS_LAMBDA_LOG_FORMAT" ))
31
32
_AWS_LAMBDA_LOG_LEVEL = _get_log_level_from_env_var (
32
33
os .environ .get ("AWS_LAMBDA_LOG_LEVEL" )
33
34
)
34
35
35
-
36
36
def _get_handler (handler ):
37
37
try :
38
38
(modname , fname ) = handler .rsplit ("." , 1 )
@@ -212,9 +212,11 @@ def handle_event_request(
212
212
)
213
213
214
214
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 )
216
219
217
- log_sink .log (lambda_unhandled_exception_warning_message , _WARNING_FRAME_TYPE )
218
220
log_error (error_result , log_sink )
219
221
lambda_runtime_client .post_invocation_error (
220
222
invoke_id , to_json (error_result ), to_json (xray_fault )
You can’t perform that action at this time.
0 commit comments