1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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.
This commit is contained in:
Niels Dossche
2024-02-18 15:35:41 +01:00
committed by GitHub
parent f1d2de7b43
commit 60518e9695

View File

@@ -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 */