diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp index d6f5f758a3..58858ef559 100644 --- a/Userland/Utilities/headless-browser.cpp +++ b/Userland/Utilities/headless-browser.cpp @@ -240,7 +240,14 @@ static ErrorOr run_test(HeadlessWebContentView& view, StringView inp if (result.is_error()) return result.release_error(); - auto expectation_file = TRY(Core::File::open(expectation_path, Core::File::OpenMode::Read)); + auto expectation_file_or_error = Core::File::open(expectation_path, Core::File::OpenMode::Read); + if (expectation_file_or_error.is_error()) { + warnln("Failed opening '{}': {}", expectation_path, expectation_file_or_error.error()); + return expectation_file_or_error.release_error(); + } + + auto expectation_file = expectation_file_or_error.release_value(); + auto expectation = TRY(String::from_utf8(StringView(TRY(expectation_file->read_until_eof()).bytes()))); auto actual = result.release_value();