Log exception that is thrown by internet connection check

This commit is contained in:
Morris Jobke 2016-07-26 10:03:31 +02:00
parent 3b6bba09d4
commit 5da813f477
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
2 changed files with 10 additions and 2 deletions

View File

@ -174,7 +174,8 @@ class Application extends App {
$c->query('URLGenerator'),
$c->query('Util'),
$c->query('L10N'),
$c->query('Checker')
$c->query('Checker'),
$c->query('Logger')
);
});

View File

@ -36,6 +36,7 @@ use OCP\AppFramework\Http\RedirectResponse;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IRequest;
use OC_Util;
use OCP\IURLGenerator;
@ -56,6 +57,8 @@ class CheckSetupController extends Controller {
private $l10n;
/** @var Checker */
private $checker;
/** @var ILogger */
private $logger;
/**
* @param string $AppName
@ -66,6 +69,7 @@ class CheckSetupController extends Controller {
* @param \OC_Util $util
* @param IL10N $l10n
* @param Checker $checker
* @param ILogger $logger
*/
public function __construct($AppName,
IRequest $request,
@ -74,7 +78,8 @@ class CheckSetupController extends Controller {
IURLGenerator $urlGenerator,
\OC_Util $util,
IL10N $l10n,
Checker $checker) {
Checker $checker,
ILogger $logger) {
parent::__construct($AppName, $request);
$this->config = $config;
$this->clientService = $clientService;
@ -82,6 +87,7 @@ class CheckSetupController extends Controller {
$this->urlGenerator = $urlGenerator;
$this->l10n = $l10n;
$this->checker = $checker;
$this->logger = $logger;
}
/**
@ -118,6 +124,7 @@ class CheckSetupController extends Controller {
$client->get($httpSiteName);
$client->get($httpsSiteName);
} catch (\Exception $e) {
$this->logger->logException($e, ['app' => 'internet_connection_check']);
return false;
}
return true;