Merge pull request #7338 from nextcloud/fix_exception_on_unreachable_server
Do not log Exception if a connection error occured
This commit is contained in:
commit
a9eb0d4a40
|
@ -31,6 +31,7 @@
|
||||||
namespace OCA\Federation\BackgroundJob;
|
namespace OCA\Federation\BackgroundJob;
|
||||||
|
|
||||||
use GuzzleHttp\Exception\ClientException;
|
use GuzzleHttp\Exception\ClientException;
|
||||||
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use OC\BackgroundJob\JobList;
|
use OC\BackgroundJob\JobList;
|
||||||
use OC\BackgroundJob\Job;
|
use OC\BackgroundJob\Job;
|
||||||
use OCA\Federation\DbHandler;
|
use OCA\Federation\DbHandler;
|
||||||
|
@ -196,6 +197,8 @@ class GetSharedSecret extends Job {
|
||||||
} else {
|
} else {
|
||||||
$this->logger->info($target . ' responded with a ' . $status . ' containing: ' . $e->getMessage(), ['app' => 'federation']);
|
$this->logger->info($target . ' responded with a ' . $status . ' containing: ' . $e->getMessage(), ['app' => 'federation']);
|
||||||
}
|
}
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
$this->logger->info('Could not connect to ' . $target, ['app' => 'federation']);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$status = Http::STATUS_INTERNAL_SERVER_ERROR;
|
$status = Http::STATUS_INTERNAL_SERVER_ERROR;
|
||||||
$this->logger->logException($e, ['app' => 'federation']);
|
$this->logger->logException($e, ['app' => 'federation']);
|
||||||
|
|
|
@ -32,6 +32,7 @@ namespace OCA\Federation\BackgroundJob;
|
||||||
|
|
||||||
|
|
||||||
use GuzzleHttp\Exception\ClientException;
|
use GuzzleHttp\Exception\ClientException;
|
||||||
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use OC\BackgroundJob\JobList;
|
use OC\BackgroundJob\JobList;
|
||||||
use OC\BackgroundJob\Job;
|
use OC\BackgroundJob\Job;
|
||||||
use OCA\Federation\DbHandler;
|
use OCA\Federation\DbHandler;
|
||||||
|
@ -196,6 +197,8 @@ class RequestSharedSecret extends Job {
|
||||||
} else {
|
} else {
|
||||||
$this->logger->info($target . ' responded with a ' . $status . ' containing: ' . $e->getMessage(), ['app' => 'federation']);
|
$this->logger->info($target . ' responded with a ' . $status . ' containing: ' . $e->getMessage(), ['app' => 'federation']);
|
||||||
}
|
}
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
$this->logger->info('Could not connect to ' . $target, ['app' => 'federation']);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$status = Http::STATUS_INTERNAL_SERVER_ERROR;
|
$status = Http::STATUS_INTERNAL_SERVER_ERROR;
|
||||||
$this->logger->logException($e, ['app' => 'federation']);
|
$this->logger->logException($e, ['app' => 'federation']);
|
||||||
|
|
Loading…
Reference in New Issue