summaryrefslogtreecommitdiffstats
path: root/apps/federation/command/syncfederationaddressbooks.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-21 17:32:39 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-12 14:24:47 +0100
commit94856cb892bba5b123c3f7e9ebeb042c960f72dd (patch)
tree7e1c3fcc1e929cf2d79116e09c3211c2803edad1 /apps/federation/command/syncfederationaddressbooks.php
parentca8c9f6ad52c6171fdecc2348fefbeef7cc5d2a3 (diff)
downloadnextcloud-server-94856cb892bba5b123c3f7e9ebeb042c960f72dd.tar.gz
nextcloud-server-94856cb892bba5b123c3f7e9ebeb042c960f72dd.zip
Catch exceptions during sync
Diffstat (limited to 'apps/federation/command/syncfederationaddressbooks.php')
-rw-r--r--apps/federation/command/syncfederationaddressbooks.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/federation/command/syncfederationaddressbooks.php b/apps/federation/command/syncfederationaddressbooks.php
index d7761d14814..9fb1e51f643 100644
--- a/apps/federation/command/syncfederationaddressbooks.php
+++ b/apps/federation/command/syncfederationaddressbooks.php
@@ -63,9 +63,13 @@ class SyncFederationAddressBooks extends Command {
$targetBookProperties = [
'{DAV:}displayname' => $url
];
- $newToken = $this->syncService->syncRemoteAddressBook($url, 'system', $sharedSecret, $syncToken, $targetPrincipal, $targetBookId, $targetBookProperties);
- if ($newToken !== $syncToken) {
- $this->dbHandler->setServerStatus($url, TrustedServers::STATUS_OK, $newToken);
+ try {
+ $newToken = $this->syncService->syncRemoteAddressBook($url, 'system', $sharedSecret, $syncToken, $targetPrincipal, $targetBookId, $targetBookProperties);
+ if ($newToken !== $syncToken) {
+ $this->dbHandler->setServerStatus($url, TrustedServers::STATUS_OK, $newToken);
+ }
+ } catch (\Exception $ex) {
+ $output->writeln("Error while syncing $url : " . $ex->getMessage());
}
}
$progress->finish();