LibWeb: Convert NodeOperations to use TRY for error propagation

This commit is contained in:
Linus Groh 2022-03-22 12:39:33 +00:00
parent 3861396fe4
commit 8d20fb1e94
Notes: sideshowbarker 2024-07-17 16:54:07 +09:00

View File

@ -35,9 +35,7 @@ ExceptionOr<NonnullRefPtr<Node>> convert_nodes_to_single_node(Vector<Variant<Non
NonnullRefPtr<Node> document_fragment = adopt_ref(*new DocumentFragment(document));
for (auto& unconverted_node : nodes) {
auto node = potentially_convert_string_to_text_node(unconverted_node);
auto result = document_fragment->append_child(node);
if (result.is_exception())
return result.exception();
(void)TRY(document_fragment->append_child(node));
}
return document_fragment;