summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-01 14:10:24 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-01 14:10:24 +0100
commit1232943aaa1474faa20cfe2912fe2f097dcbd5f2 (patch)
tree79c44bf8a6031cf986c3e2c8b93b06cffe5a1b54 /apps
parente23cd3501901fb6b816df37f4f0394d5ffa2a4dd (diff)
parent2d469e39af2c63075a13a38b5129ed0a9044d3ee (diff)
downloadnextcloud-server-1232943aaa1474faa20cfe2912fe2f097dcbd5f2.tar.gz
nextcloud-server-1232943aaa1474faa20cfe2912fe2f097dcbd5f2.zip
Merge pull request #22046 from owncloud/improved_error_handling
Improved error handling
Diffstat (limited to 'apps')
-rw-r--r--apps/federation/api/ocsauthapi.php8
-rw-r--r--apps/federation/backgroundjob/getsharedsecret.php3
-rw-r--r--apps/federation/backgroundjob/requestsharedsecret.php3
3 files changed, 10 insertions, 4 deletions
diff --git a/apps/federation/api/ocsauthapi.php b/apps/federation/api/ocsauthapi.php
index 083be1b7ecd..058a5966374 100644
--- a/apps/federation/api/ocsauthapi.php
+++ b/apps/federation/api/ocsauthapi.php
@@ -99,7 +99,7 @@ class OCSAuthAPI {
$token = $this->request->getParam('token');
if ($this->trustedServers->isTrustedServer($url) === false) {
- $this->logger->log(\OCP\Util::ERROR, 'remote server not trusted (' . $url . ') while requesting shared secret');
+ $this->logger->log(\OCP\Util::ERROR, 'remote server not trusted (' . $url . ') while requesting shared secret', ['app' => 'federation']);
return new \OC_OCS_Result(null, HTTP::STATUS_FORBIDDEN);
}
@@ -107,7 +107,7 @@ class OCSAuthAPI {
// token wins
$localToken = $this->dbHandler->getToken($url);
if (strcmp($localToken, $token) > 0) {
- $this->logger->log(\OCP\Util::ERROR, 'remote server (' . $url . ') presented lower token');
+ $this->logger->log(\OCP\Util::ERROR, 'remote server (' . $url . ') presented lower token', ['app' => 'federation']);
return new \OC_OCS_Result(null, HTTP::STATUS_FORBIDDEN);
}
@@ -134,12 +134,12 @@ class OCSAuthAPI {
$token = $this->request->getParam('token');
if ($this->trustedServers->isTrustedServer($url) === false) {
- $this->logger->log(\OCP\Util::ERROR, 'remote server not trusted (' . $url . ') while getting shared secret');
+ $this->logger->log(\OCP\Util::ERROR, 'remote server not trusted (' . $url . ') while getting shared secret', ['app' => 'federation']);
return new \OC_OCS_Result(null, HTTP::STATUS_FORBIDDEN);
}
if ($this->isValidToken($url, $token) === false) {
- $this->logger->log(\OCP\Util::ERROR, 'remote server (' . $url . ') didn\'t send a valid token (got ' . $token . ') while getting shared secret');
+ $this->logger->log(\OCP\Util::ERROR, 'remote server (' . $url . ') didn\'t send a valid token (got ' . $token . ') while getting shared secret', ['app' => 'federation']);
return new \OC_OCS_Result(null, HTTP::STATUS_FORBIDDEN);
}
diff --git a/apps/federation/backgroundjob/getsharedsecret.php b/apps/federation/backgroundjob/getsharedsecret.php
index cae446f915c..a98a17e323b 100644
--- a/apps/federation/backgroundjob/getsharedsecret.php
+++ b/apps/federation/backgroundjob/getsharedsecret.php
@@ -151,6 +151,9 @@ class GetSharedSecret extends QueuedJob{
} catch (ClientException $e) {
$status = $e->getCode();
$this->logger->logException($e);
+ } catch (\Exception $e) {
+ $status = HTTP::STATUS_INTERNAL_SERVER_ERROR;
+ $this->logger->logException($e);
}
// if we received a unexpected response we try again later
diff --git a/apps/federation/backgroundjob/requestsharedsecret.php b/apps/federation/backgroundjob/requestsharedsecret.php
index 92305b7e8ea..2db5d09545a 100644
--- a/apps/federation/backgroundjob/requestsharedsecret.php
+++ b/apps/federation/backgroundjob/requestsharedsecret.php
@@ -149,6 +149,9 @@ class RequestSharedSecret extends QueuedJob {
} catch (ClientException $e) {
$status = $e->getCode();
$this->logger->logException($e);
+ } catch (\Exception $e) {
+ $status = HTTP::STATUS_INTERNAL_SERVER_ERROR;
+ $this->logger->logException($e);
}
// if we received a unexpected response we try again later