Skip to content

fn type_name_of_val<T> is non-deterministic #243

@rimutaka

Description

@rimutaka

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

  1. Confirm if fn type_name_of_val is in fact non-deterministic.
  2. Find a way to allow the handler code set the error type, e.g. Error logging and examples #242 (comment)
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions