Skip to content

feat: improve error message for failed structuredClone calls #140

@KnorpelSenf

Description

@KnorpelSenf
await conversation.external(() => () => 0)

throws a confusing error.

It throws an error because the function passed to external returns a function. That is a return value that cannot be cloned, which is why structuredClone errors out. The code also is incorrect because the function cannot be serialised.

We should catch the error and throw a new error with a more helpful error message. It should include the original error as its cause.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions