mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
LibCore: Make Core::File::open() return OSError in case of failure
This commit is contained in:
parent
1474a537b6
commit
13f4890c38
8 changed files with 15 additions and 15 deletions
|
@ -18,7 +18,7 @@ TESTJS_GLOBAL_FUNCTION(read_binary_wasm_file, readBinaryWasmFile)
|
|||
return {};
|
||||
auto file = Core::File::open(filename, Core::OpenMode::ReadOnly);
|
||||
if (file.is_error()) {
|
||||
vm.throw_exception<JS::TypeError>(global_object, file.error());
|
||||
vm.throw_exception<JS::TypeError>(global_object, file.error().string());
|
||||
return {};
|
||||
}
|
||||
auto contents = file.value()->read_all();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue