From c5a2b5967651f6ad7e8baee45a0dcf725b8a5115 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 17 Feb 2024 22:28:24 +0100 Subject: [PATCH] Update error handling when node cannot be added This can only fail on OOM, so be consistent with the other locations and throw an INVALID_STATE_ERR. --- ext/dom/node.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/dom/node.c b/ext/dom/node.c index 5ce85a2f285a..dfa5b825983c 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -1285,8 +1285,7 @@ PHP_METHOD(DOMNode, appendChild) DOM_RET_OBJ(new_child, &ret, intern); return; cannot_add: - // TODO Convert to Error? - php_error_docref(NULL, E_WARNING, "Couldn't append node"); + php_dom_throw_error(INVALID_STATE_ERR, stricterror); RETURN_FALSE; } /* }}} end dom_node_append_child */