From 486e7e5ed12c3353ff7e5779cf5da3243feb8b10 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 10 Apr 2015 11:55:58 +0200 Subject: Catch more exceptions when connecting to remote DAV server Added InvalidArgumentException to catch HTML parsing errors when XML was expected. Made convertSabreException more generic to be able to handle more exception cases. --- apps/files_sharing/lib/external/storage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps/files_sharing') diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php index 648376e8cb5..449d7a7eff5 100644 --- a/apps/files_sharing/lib/external/storage.php +++ b/apps/files_sharing/lib/external/storage.php @@ -237,7 +237,8 @@ class Storage extends DAV implements ISharedStorage { $errorMessage = curl_error($ch); curl_close($ch); if (!empty($errorMessage)) { - throw new \Exception($errorMessage); + \OCP\Util::writeLog('files_sharing', 'Error getting remote share info: ' . $errorMessage, \OCP\Util::ERROR); + throw new StorageNotAvailableException($errorMessage); } switch ($status) { -- cgit v1.2.3