Skip to content

Neovim crashing on errors #231

@ricardokl

Description

@ricardokl

Hi,

When I try to deserialize data into a Struct, I have the following situation:

  • Passing correct data works perfectly.
  • Passing wrong values or wrong keys crashes Neovim

I can get around this by never returning an error, instead using something like err_writeln. With this, passing wrong values/keys will correctly report an error back (no crashing).

Since the Function::from expects something that can return an error, I'm assuming this is unwanted behavior. This can be seen from the "mechanic" example by passing {manufacturer = "Nikola", miles = 20}, which returns nothing, and then mistyping the key, as {manufacture = "Nikola", miles = 20}, which crashes Neovim.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions