Commit 4a93df57 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Stürzt eine Suchmaschine ab, stürzt nicht mehr das gesamte Skript ab.

Exalead Bugfix bei dem Ein Fehler geworfen wurde, wenn Exalead keine Ergebnisse geliefert hat.
parent df68772e
...@@ -435,7 +435,13 @@ class MetaGer ...@@ -435,7 +435,13 @@ class MetaGer
{ {
if(!$engine->loaded) if(!$engine->loaded)
{ {
$engine->retrieveResults(); try{
$engine->retrieveResults();
} catch(\ErrorException $e)
{
Log::error($e);
}
} }
} }
......
...@@ -37,7 +37,12 @@ class Exalead extends Searchengine ...@@ -37,7 +37,12 @@ class Exalead extends Searchengine
$namespace = $strNamespace; $namespace = $strNamespace;
} }
$results->registerXPathNamespace($prefix,$namespace); $results->registerXPathNamespace($prefix,$namespace);
$results = $results->xpath("//a:hits/a:Hit"); try{
$results = $results->xpath("//a:hits/a:Hit");
} catch(\ErrorException $e)
{
return;
}
foreach($results as $result) foreach($results as $result)
{ {
$result->registerXPathNamespace($prefix,$namespace); $result->registerXPathNamespace($prefix,$namespace);
......
Supports Markdown
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