diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-02-10 17:23:54 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-02-17 10:03:57 +0100 |
commit | f2f5769df7d4c2b33a847e86a71d94d5c689decd (patch) | |
tree | 86c2cd4733483b5404b54353d8516841643ab618 /settings | |
parent | 2ab062193a355e87946f310c992d5449eaf558cc (diff) | |
download | nextcloud-server-f2f5769df7d4c2b33a847e86a71d94d5c689decd.tar.gz nextcloud-server-f2f5769df7d4c2b33a847e86a71d94d5c689decd.zip |
catch errors during decryption
Diffstat (limited to 'settings')
-rw-r--r-- | settings/ajax/decryptall.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/settings/ajax/decryptall.php b/settings/ajax/decryptall.php index ebc17aacfaa..d7c104ab151 100644 --- a/settings/ajax/decryptall.php +++ b/settings/ajax/decryptall.php @@ -16,7 +16,14 @@ $util = new \OCA\Encryption\Util($view, \OCP\User::getUser()); $result = $util->initEncryption($params); if ($result !== false) { - $successful = $util->decryptAll(); + + try { + $successful = $util->decryptAll(); + } catch (\Exception $ex) { + \OCP\Util::writeLog('encryption library', "Decryption finished unexpected: " . $ex->getMessage(), \OCP\Util::ERROR); + $successful = false; + } + if ($successful === true) { \OCP\JSON::success(array('data' => array('message' => 'Files decrypted successfully'))); } else { |