Skip to content

Commit 60518e9

Browse files
authored
Update error handling when node cannot be added (#13421)
This can only fail on OOM, so be consistent with the other locations and throw an INVALID_STATE_ERR.
1 parent f1d2de7 commit 60518e9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ext/dom/node.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,8 +1285,7 @@ PHP_METHOD(DOMNode, appendChild)
12851285
DOM_RET_OBJ(new_child, &ret, intern);
12861286
return;
12871287
cannot_add:
1288-
// TODO Convert to Error?
1289-
php_error_docref(NULL, E_WARNING, "Couldn't append node");
1288+
php_dom_throw_error(INVALID_STATE_ERR, stricterror);
12901289
RETURN_FALSE;
12911290
}
12921291
/* }}} end dom_node_append_child */

0 commit comments

Comments
 (0)