From: Bjoern Schiessle Date: Mon, 7 Oct 2013 09:06:24 +0000 (+0200) Subject: catch exception if db query execution fails X-Git-Tag: v6.0.0alpha2~78^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=288f01bf6262d825527d71ba262bcaa5d082268d;p=nextcloud-server.git catch exception if db query execution fails --- diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php index e40cbc17dc1..08aaa62e252 100644 --- a/apps/files_sharing/lib/updater.php +++ b/apps/files_sharing/lib/updater.php @@ -67,7 +67,11 @@ class Shared_Updater { $fileSource = $fileInfo['fileid']; $query = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `file_source`=?'); - \OC_DB::executeAudited($query, array($fileSource)); + try { + \OC_DB::executeAudited($query, array($fileSource)); + } catch (\Exception $e) { + \OCP\Util::writeLog('files_sharing', "can't remove share: " . $e->getMessage(), \OCP\Util::WARN); + } } /**