summaryrefslogtreecommitdiffstats
path: root/application/exceptions
diff options
context:
space:
mode:
Diffstat (limited to 'application/exceptions')
-rw-r--r--application/exceptions/FileUploadVerifyException.php2
-rw-r--r--application/exceptions/VerifyException.php23
2 files changed, 24 insertions, 1 deletions
diff --git a/application/exceptions/FileUploadVerifyException.php b/application/exceptions/FileUploadVerifyException.php
index d091c1eab..5125e4822 100644
--- a/application/exceptions/FileUploadVerifyException.php
+++ b/application/exceptions/FileUploadVerifyException.php
@@ -6,7 +6,7 @@
*/
namespace exceptions;
-class FileUploadVerifyException extends UserInputException {
+class FileUploadVerifyException extends VerifyException {
public function __toString()
{
$ret = $this->getMessage()."\n";
diff --git a/application/exceptions/VerifyException.php b/application/exceptions/VerifyException.php
new file mode 100644
index 000000000..0e9d8b93a
--- /dev/null
+++ b/application/exceptions/VerifyException.php
@@ -0,0 +1,23 @@
+<?php
+/*
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+namespace exceptions;
+
+class VerifyException extends UserInputException {
+ public function __toString()
+ {
+ $ret = $this->getMessage()."\n";
+ $data = $this->get_data();
+ $errors = array();
+
+ foreach ($data as $error) {
+ $errors[] = sprintf("%s: %s", $error["id"], $error["reason"]);
+ }
+
+ $ret .= implode("\n", $errors);
+ return $ret;
+ }
+}