summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-01-06 18:35:09 +0100
committerLukas Reschke <lukas@owncloud.com>2015-01-06 18:35:09 +0100
commit7528a1a47503e1ced9b5753a38f3624d7059f8d6 (patch)
tree5a531016a765a71eb286cafec755378ef6490fc2 /apps/files
parent47eb0c59e6c1514638cb8695d2b92ff41e4bf2e1 (diff)
parent64e3ebae74b9f47369b946fbda89a0ce6f6ffe04 (diff)
downloadnextcloud-server-7528a1a47503e1ced9b5753a38f3624d7059f8d6.tar.gz
nextcloud-server-7528a1a47503e1ced9b5753a38f3624d7059f8d6.zip
Merge pull request #13130 from owncloud/getstoragestats-error-handling
Add error handling to getstoragestats.php
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/ajax/getstoragestats.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files/ajax/getstoragestats.php b/apps/files/ajax/getstoragestats.php
index 4ab5b9a779c..fb7ccdc86cc 100644
--- a/apps/files/ajax/getstoragestats.php
+++ b/apps/files/ajax/getstoragestats.php
@@ -10,4 +10,8 @@ OCP\JSON::checkLoggedIn();
\OC::$server->getSession()->close();
// send back json
-OCP\JSON::success(array('data' => \OCA\Files\Helper::buildFileStorageStatistics($dir)));
+try {
+ OCP\JSON::success(array('data' => \OCA\Files\Helper::buildFileStorageStatistics($dir)));
+} catch (\OCP\Files\NotFoundException $e) {
+ OCP\JSON::error(['data' => ['message' => 'Folder not found']]);
+}