From 805627f3f1deb6b05821953dee3bed7bb7bd37e4 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Tue, 3 Sep 2024 12:45:51 +0200 Subject: [PATCH] Moved post_init_error again under exception handling block to preserve possibility of sys.exc_info() in monkey patched post_init_error function --- awslambdaric/bootstrap.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/awslambdaric/bootstrap.py b/awslambdaric/bootstrap.py index 0f19f56..db9dae6 100644 --- a/awslambdaric/bootstrap.py +++ b/awslambdaric/bootstrap.py @@ -478,11 +478,11 @@ def run(app_root, handler, lambda_runtime_api_addr): except Exception: error_result = build_fault_result(sys.exc_info(), None) - if error_result is not None: - log_error(error_result, log_sink) - lambda_runtime_client.post_init_error(error_result) + if error_result is not None: + log_error(error_result, log_sink) + lambda_runtime_client.post_init_error(error_result) - sys.exit(1) + sys.exit(1) while True: event_request = lambda_runtime_client.wait_next_invocation()