Skip to content
Snippets Groups Projects
Commit 3187a418 authored by Dorian Merz's avatar Dorian Merz
Browse files

refs #16762 [master] fixup in Ebsco Recommend

* do not throw Exception on parse error
* avoids breakdown of search results page
parent b152b490
No related merge requests found
...@@ -166,12 +166,17 @@ class EbscoResults implements ...@@ -166,12 +166,17 @@ class EbscoResults implements
if (!$results->isSuccess()) { if (!$results->isSuccess()) {
$this->results = false; $this->results = false;
return;
} }
$this->results = $this->sortByHits( $this->results = $this->sortByHits(
json_decode($results->getBody(), true) json_decode($results->getBody(), true)
); );
if (json_last_error() !== JSON_ERROR_NONE) { if (json_last_error() !== JSON_ERROR_NONE) {
throw new \Exception('JSON type error ' . json_last_error_msg()); $this->debug(
'JSON type error "'
. json_last_error_msg().'"'
. (empty($results->getBody()) ? '. EBSCO result was empty.' : '')
);
} }
} }
......
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