Commit 393cc38a 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 7fcbb143
...@@ -435,7 +435,13 @@ class MetaGer ...@@ -435,7 +435,13 @@ class MetaGer
{ {
if(!$engine->loaded) if(!$engine->loaded)
{ {
try{
$engine->retrieveResults(); $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);
try{
$results = $results->xpath("//a:hits/a:Hit"); $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);
......
Markdown is supported
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