]> source.dussan.org Git - nextcloud-server.git/commitdiff
Log exception that is thrown by internet connection check 563/head
authorMorris Jobke <hey@morrisjobke.de>
Tue, 26 Jul 2016 08:03:31 +0000 (10:03 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Tue, 26 Jul 2016 08:03:31 +0000 (10:03 +0200)
settings/Application.php
settings/Controller/CheckSetupController.php

index 657b3fe490a5bd45d3ab7f2c530bf05955abfeb2..6db5e2aabf61c2c05bf6340821a982234a48c90b 100644 (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')
                        );
                });
 
index bfb83e91936138bf7d0841cdf4b0de9651d1ac3e..13e7e443621c5eb14d6ab6d6e6b9d7a3abab8fec 100644 (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;