mirror of
https://github.com/friendica/friendica
synced 2025-04-22 07:50:11 +00:00
Exception handling added at many places
This commit is contained in:
parent
e6daaf49ce
commit
518382036b
16 changed files with 174 additions and 44 deletions
|
@ -109,10 +109,20 @@ class MatchInterests extends BaseModule
|
|||
continue;
|
||||
}
|
||||
|
||||
$result = $this->httpClient->post($server . '/search/user/tags', $searchParameters, [], 0, HttpClientRequest::CONTACTDISCOVER);
|
||||
try {
|
||||
$result = $this->httpClient->post($server . '/search/user/tags', $searchParameters, [], 0, HttpClientRequest::CONTACTDISCOVER);
|
||||
} catch (\Throwable $th) {
|
||||
$this->logger->notice('Got exception', ['code' => $th->getCode(), 'message' => $th->getMessage()]);
|
||||
continue;
|
||||
}
|
||||
if (!$result->isSuccess()) {
|
||||
// try legacy endpoint
|
||||
$result = $this->httpClient->post($server . '/msearch', $searchParameters, [], 0, HttpClientRequest::CONTACTDISCOVER);
|
||||
try {
|
||||
$result = $this->httpClient->post($server . '/msearch', $searchParameters, [], 0, HttpClientRequest::CONTACTDISCOVER);
|
||||
} catch (\Throwable $th) {
|
||||
$this->logger->notice('Got exception', ['code' => $th->getCode(), 'message' => $th->getMessage()]);
|
||||
continue;
|
||||
}
|
||||
if (!$result->isSuccess()) {
|
||||
$this->logger->notice('Search-Endpoint not available for server.', ['server' => $server]);
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue