mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 17:18:11 +00:00
LibWasm: Add some more descriptive parse errors
It's much better to tell the user "hey, the magic numbers don't check out" than "oh there was a problem with your input" :P Also refactors some stuff to make it possible to efficiently use the parser error enum without it getting in the way.
This commit is contained in:
parent
aa4d8d26b9
commit
426878c884
3 changed files with 181 additions and 82 deletions
|
@ -27,6 +27,7 @@ int main(int argc, char* argv[])
|
|||
auto parse_result = Wasm::Module::parse(stream);
|
||||
if (parse_result.is_error()) {
|
||||
warnln("Something went wrong, either the file is invalid, or there's a bug with LibWasm!");
|
||||
warnln("The parse error was {}", Wasm::parse_error_to_string(parse_result.error()));
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue