summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-07-03 14:56:37 +0200
committerRobin Appelman <robin@icewind.nl>2018-07-03 14:56:37 +0200
commit27089422e13c74b570a25d62827d83f4b2274329 (patch)
treee46204c453d67ceea6f4e0775cb50b6834511c3c /apps
parentaa64584d679d0d5836ce2e08197d58fe2f8f4a86 (diff)
downloadnextcloud-server-27089422e13c74b570a25d62827d83f4b2274329.tar.gz
nextcloud-server-27089422e13c74b570a25d62827d83f4b2274329.zip
Improved logging of smb connection errors
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/Connector/Sabre/ObjectTree.php2
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php8
2 files changed, 9 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php
index 15988cdadb4..ae185b1a611 100644
--- a/apps/dav/lib/Connector/Sabre/ObjectTree.php
+++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php
@@ -159,7 +159,7 @@ class ObjectTree extends CachingTree {
throw new StorageNotAvailableException();
}
} catch (StorageNotAvailableException $e) {
- throw new \Sabre\DAV\Exception\ServiceUnavailable('Storage is temporarily not available');
+ throw new \Sabre\DAV\Exception\ServiceUnavailable('Storage is temporarily not available', 0, $e);
} catch (StorageInvalidException $e) {
throw new \Sabre\DAV\Exception\NotFound('Storage ' . $path . ' is invalid');
} catch (LockedException $e) {
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index 6213e54dff9..94b4a4e7f34 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -154,6 +154,7 @@ class SMB extends Common implements INotifyStorage {
}
return $this->statCache[$path];
} catch (ConnectException $e) {
+ \OC::$server->getLogger()->logException($e, ['message' => 'Error while getting file info']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
}
}
@@ -180,6 +181,7 @@ class SMB extends Common implements INotifyStorage {
}
});
} catch (ConnectException $e) {
+ \OC::$server->getLogger()->logException($e, ['message' => 'Error while getting folder content']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
}
}
@@ -304,6 +306,7 @@ class SMB extends Common implements INotifyStorage {
} catch (ForbiddenException $e) {
return false;
} catch (ConnectException $e) {
+ \OC::$server->getLogger()->logException($e, ['message' => 'Error while deleting file']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
}
}
@@ -388,6 +391,7 @@ class SMB extends Common implements INotifyStorage {
} catch (ForbiddenException $e) {
return false;
} catch (ConnectException $e) {
+ \OC::$server->getLogger()->logException($e, ['message' => 'Error while opening file']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
}
}
@@ -414,6 +418,7 @@ class SMB extends Common implements INotifyStorage {
} catch (ForbiddenException $e) {
return false;
} catch (ConnectException $e) {
+ \OC::$server->getLogger()->logException($e, ['message' => 'Error while removing folder']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
}
}
@@ -427,6 +432,7 @@ class SMB extends Common implements INotifyStorage {
}
return false;
} catch (ConnectException $e) {
+ \OC::$server->getLogger()->logException($e, ['message' => 'Error while creating file']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
}
}
@@ -462,6 +468,7 @@ class SMB extends Common implements INotifyStorage {
$this->share->mkdir($path);
return true;
} catch (ConnectException $e) {
+ \OC::$server->getLogger()->logException($e, ['message' => 'Error while creating folder']);
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
} catch (Exception $e) {
return false;
@@ -535,6 +542,7 @@ class SMB extends Common implements INotifyStorage {
try {
return parent::test();
} catch (Exception $e) {
+ \OC::$server->getLogger()->logException($e);
return false;
}
}