From 64e3ebae74b9f47369b946fbda89a0ce6f6ffe04 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 6 Jan 2015 15:56:06 +0100 Subject: Add error handling to getstoragestats.php --- apps/files/ajax/getstoragestats.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apps/files/ajax') 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']]); +} -- cgit v1.2.3