diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-11-29 16:28:38 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-11-29 16:37:54 +0100 |
commit | d24b6866b1624666af751dfd6cdb25e49c591edd (patch) | |
tree | a77ec1c73d0ede0c7fbd1fa401b089e16c6cb6af /apps/federation/lib/BackgroundJob | |
parent | a9eb0d4a4084d9590cb954f385af0137ce399ca3 (diff) | |
download | nextcloud-server-d24b6866b1624666af751dfd6cdb25e49c591edd.tar.gz nextcloud-server-d24b6866b1624666af751dfd6cdb25e49c591edd.zip |
Actually set the status so we don't cause another exception
* And add tests so I don't mess up again
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/federation/lib/BackgroundJob')
-rw-r--r-- | apps/federation/lib/BackgroundJob/GetSharedSecret.php | 1 | ||||
-rw-r--r-- | apps/federation/lib/BackgroundJob/RequestSharedSecret.php | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/apps/federation/lib/BackgroundJob/GetSharedSecret.php b/apps/federation/lib/BackgroundJob/GetSharedSecret.php index 0c621aa40ea..6090f521fcc 100644 --- a/apps/federation/lib/BackgroundJob/GetSharedSecret.php +++ b/apps/federation/lib/BackgroundJob/GetSharedSecret.php @@ -198,6 +198,7 @@ class GetSharedSecret extends Job { $this->logger->info($target . ' responded with a ' . $status . ' containing: ' . $e->getMessage(), ['app' => 'federation']); } } catch (ConnectException $e) { + $status = -1; // There is no status code if we could not connect $this->logger->info('Could not connect to ' . $target, ['app' => 'federation']); } catch (\Exception $e) { $status = Http::STATUS_INTERNAL_SERVER_ERROR; diff --git a/apps/federation/lib/BackgroundJob/RequestSharedSecret.php b/apps/federation/lib/BackgroundJob/RequestSharedSecret.php index 09de76cba95..a201c9dccb6 100644 --- a/apps/federation/lib/BackgroundJob/RequestSharedSecret.php +++ b/apps/federation/lib/BackgroundJob/RequestSharedSecret.php @@ -198,6 +198,7 @@ class RequestSharedSecret extends Job { $this->logger->info($target . ' responded with a ' . $status . ' containing: ' . $e->getMessage(), ['app' => 'federation']); } } catch (ConnectException $e) { + $status = -1; // There is no status code if we could not connect $this->logger->info('Could not connect to ' . $target, ['app' => 'federation']); } catch (\Exception $e) { $status = Http::STATUS_INTERNAL_SERVER_ERROR; |