mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
LibWeb: Improve error message for IDL generation with missing interface
Instead of a cryptic error that occurs due to an interface with no name, fail early on by explicitly checking that an interface was parsed with a name.
This commit is contained in:
parent
91efa1d568
commit
10add8aa8a
Notes:
sideshowbarker
2024-07-17 04:10:16 +09:00
Author: https://github.com/shannonbooth
Commit: 10add8aa8a
Pull-request: https://github.com/SerenityOS/serenity/pull/24125
1 changed files with 9 additions and 2 deletions
|
@ -434,8 +434,15 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
// TODO: service_worker_exposed
|
||||
|
||||
for (size_t i = 0; i < paths.size(); ++i) {
|
||||
IDL::Parser parser(paths[i], file_contents[i], lexical_base.string());
|
||||
TRY(add_to_interface_sets(parser.parse(), intrinsics, window_exposed, dedicated_worker_exposed, shared_worker_exposed));
|
||||
auto const& path = paths[i];
|
||||
IDL::Parser parser(path, file_contents[i], lexical_base.string());
|
||||
auto& interface = parser.parse();
|
||||
if (interface.name.is_empty()) {
|
||||
s_error_string = ByteString::formatted("Interface for file {} missing", path);
|
||||
return Error::from_string_view(s_error_string.view());
|
||||
}
|
||||
|
||||
TRY(add_to_interface_sets(interface, intrinsics, window_exposed, dedicated_worker_exposed, shared_worker_exposed));
|
||||
parsers.append(move(parser));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue