[BUG] PHP warning Undefined array key "root_cause"
in Connection::tryDeserializeError()
#167
Labels
bug
Something isn't working
What is the bug?
The code for “2.0 structured exceptions” is faulty in
\OpenSearch\Connections\Connection::tryDeserializeError()
. It will produce a warning (Undefined array key "root_cause"
) if$error['error']['root_cause']
is not set.This happens, e.g., when the OpenSearch server returns a 403 error status. In this case, the
error
key of the response contains just the keysreason
andtype
.How can one reproduce the bug?
Undefined array key "root_cause"
.What is the expected behavior?
Erorr responses without
root_cause
should be handled without producing a PHP warning.What is your host/environment?
The text was updated successfully, but these errors were encountered: