Skip to content

Commit

Permalink
Should not be throwing exception if an individual search driver fails
Browse files Browse the repository at this point in the history
See Bug #13171 : My search results suddenly became empty because one of
my search drivers (Facebook) suddenly started failing.  For a remote API
call, we should be trying to return as many matches as possible while
ignoring errors.
  • Loading branch information
slusarz committed May 7, 2014
1 parent 9379430 commit 1e61b6d
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions turba/lib/Api.php
Expand Up @@ -1179,15 +1179,20 @@ public function search($names = null, array $opts = array())
}
}

$search = $sdriver->search(
$criteria,
Turba::getPreferredSortOrder(),
'OR',
$opts['returnFields'],
$opts['customStrict'],
$opts['matchBegin'],
$opts['count_only']
);
try {
$search = $sdriver->search(
$criteria,
Turba::getPreferredSortOrder(),
'OR',
$opts['returnFields'],
$opts['customStrict'],
$opts['matchBegin'],
$opts['count_only']
);
} catch (Exception $e) {
continue;
}

if ($opts['count_only']) {
$results += $search;

Expand Down

0 comments on commit 1e61b6d

Please sign in to comment.