Skip to content
Snippets Groups Projects
Commit 35a4b518 authored by Ere Maijala's avatar Ere Maijala Committed by Robert Lange
Browse files

Avoid PHP error if Alma API response doesn't contain an error message. (#1522)

- This can happen at least if the API key is valid but not properly routing to the Alma instance.
parent 250a8e57
No related merge requests found
...@@ -226,7 +226,8 @@ class Alma extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterface ...@@ -226,7 +226,8 @@ class Alma extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterface
} }
$returnValue = $xml; $returnValue = $xml;
} else { } else {
$almaErrorMsg = $xml->errorList->error[0]->errorMessage; $almaErrorMsg = $xml->errorList->error[0]->errorMessage
?? '[could not parse error message]';
error_log( error_log(
'[ALMA] ' . $almaErrorMsg . ' | Call to: ' . $client->getUri() . '[ALMA] ' . $almaErrorMsg . ' | Call to: ' . $client->getUri() .
'. GET params: ' . var_export($paramsGet, true) . '. POST params: ' . '. GET params: ' . var_export($paramsGet, true) . '. POST params: ' .
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment