mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
committed by
Andreas Kling
parent
91efa1d568
commit
10add8aa8a
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user