lunatic-solutions / lunatic

Lunatic is an Erlang-inspired runtime for WebAssembly
https://lunatic.solutions
Apache License 2.0
4.62k stars 138 forks source link

Add better error message when module is not found #181

Closed tqwewe closed 1 year ago

tqwewe commented 1 year ago

Fixes #180

When a module is not found when using run, a better error is shown.

Before:

❯ lunatic run foo.wasm
Error: No such file or directory (os error 2)

After:

❯ lunatic run foo.wasm
Error: Module 'foo.wasm' not found

The main concern is that the No such file or directory error could come from the foo.wasm itself trying to open a file.