summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib/exceptions
diff options
context:
space:
mode:
Diffstat (limited to 'apps/encryption/lib/exceptions')
-rw-r--r--apps/encryption/lib/exceptions/multikeydecryptexception.php4
-rw-r--r--apps/encryption/lib/exceptions/multikeyencryptexception.php4
-rw-r--r--apps/encryption/lib/exceptions/privatekeymissingexception.php14
-rw-r--r--apps/encryption/lib/exceptions/publickeymissingexception.php20
4 files changed, 38 insertions, 4 deletions
diff --git a/apps/encryption/lib/exceptions/multikeydecryptexception.php b/apps/encryption/lib/exceptions/multikeydecryptexception.php
index 36a95544e61..1466d35eda3 100644
--- a/apps/encryption/lib/exceptions/multikeydecryptexception.php
+++ b/apps/encryption/lib/exceptions/multikeydecryptexception.php
@@ -2,6 +2,8 @@
namespace OCA\Encryption\Exceptions;
-class MultiKeyDecryptException extends \Exception {
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class MultiKeyDecryptException extends GenericEncryptionException {
}
diff --git a/apps/encryption/lib/exceptions/multikeyencryptexception.php b/apps/encryption/lib/exceptions/multikeyencryptexception.php
index e518a09d1cc..daf528e2cf7 100644
--- a/apps/encryption/lib/exceptions/multikeyencryptexception.php
+++ b/apps/encryption/lib/exceptions/multikeyencryptexception.php
@@ -2,6 +2,8 @@
namespace OCA\Encryption\Exceptions;
-class MultiKeyEncryptException extends \Exception {
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class MultiKeyEncryptException extends GenericEncryptionException {
}
diff --git a/apps/encryption/lib/exceptions/privatekeymissingexception.php b/apps/encryption/lib/exceptions/privatekeymissingexception.php
index ddc3d11cdbc..50d75870b20 100644
--- a/apps/encryption/lib/exceptions/privatekeymissingexception.php
+++ b/apps/encryption/lib/exceptions/privatekeymissingexception.php
@@ -19,10 +19,20 @@
*
*/
-
namespace OCA\Encryption\Exceptions;
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class PrivateKeyMissingException extends GenericEncryptionException {
-class PrivateKeyMissingException extends \Exception{
+ /**
+ * @param string $userId
+ */
+ public function __construct($userId) {
+ if(empty($userId)) {
+ $userId = "<no-user-id-given>";
+ }
+ parent::__construct("Private Key missing for user: $userId");
+ }
}
diff --git a/apps/encryption/lib/exceptions/publickeymissingexception.php b/apps/encryption/lib/exceptions/publickeymissingexception.php
new file mode 100644
index 00000000000..9638c28e427
--- /dev/null
+++ b/apps/encryption/lib/exceptions/publickeymissingexception.php
@@ -0,0 +1,20 @@
+<?php
+
+
+namespace OCA\Encryption\Exceptions;
+
+use OCP\Encryption\Exceptions\GenericEncryptionException;
+
+class PublicKeyMissingException extends GenericEncryptionException {
+
+ /**
+ * @param string $userId
+ */
+ public function __construct($userId) {
+ if(empty($userId)) {
+ $userId = "<no-user-id-given>";
+ }
+ parent::__construct("Public Key missing for user: $userId");
+ }
+
+}