aws / aws/aws-lambda-python-runtime-interface-client

Feature Request: Disable lambda_unhandled_exception_warning_message

Đang mở
#139 2 bình luận 6 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
294
Fork
84
Merge trung bình
3 ngày 7 phút
Pull request đã merge (30 ngày)
3

Mô tả

The lambda_unhandled_exception_warning_message (`LAMBDA_WARNING: Unhandled exception...`) is ~ 633 chars and adds little value to our debugging. I understand the desire to warn people the runtime may have changed underfoot, and that's why their code is raising exceptions, but I'd like a way to disable it.

A pr from me would probably be something like

```
_disable_unhandled_exception_warning = bool(os.environ.get("AWS_LAMBDA_EXCEPTION_WARNING_DISABLE"))
# SNIP ...
if _disable_unhandled_exception_warning:
from .lambda_literals import lambda_unhandled_exception_warning_message

log_sink.log(lambda_unhandled_exception_warning_message, _WARNING_FRAME_TYPE)

log_error(error_result, log_sink)
lambda_runtime_client.post_invocation_error(
invoke_id, to_json(error_result), to_json(xray_fault)
)
```
near https://github.com/aws/aws-lambda-python-runtime-interface-client/blob/056aa365b6b986b0f413d031f054598064df603e/awslambdaric/bootstrap.py#L217

Perhaps you have a different idea? Or maybe this is a non-starter. Didn't want to clutter PRs before asking.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.