-
Notifications
You must be signed in to change notification settings - Fork 363
Description
It seems that function fn type_name_of_val in lib.rs always returns the same value:
alloc::boxed::Box<dyn std::error::Error+core::marker::Sync+core::marker::Send>
which is propagated to the response and CloudWatch.
That value is not user-friendly and is hard to parse downstream.
Other parts of the code return values like InvalidEventDataError, which is friendly and consistent with what other runtimes do.
Proposal
- Confirm if fn type_name_of_val is in fact non-deterministic.
- Find a way to allow the handler code set the error type, e.g. Error logging and examples #242 (comment)
- In the interim, replace the function with a constant value, e.g. "HandlerError" for the next release.
Making later changes to this part of the code will break compatibility for the handler code, client applications processing the lambda response and monitoring applications parsing CloudWatch message. I would prefer us to make an interim change to minimize that impact.
If there is no consensus on this, we may just advise the developers to ignore this field for now and rely on the structured data inside Diagnostic.error_message
.