summaryrefslogtreecommitdiffstats
path: root/application/service
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-02-02 19:45:11 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-02-02 19:45:11 +0100
commit33efe571e3e7ebd607e92345c2e94e7fd8ae27f0 (patch)
tree6d24b9e3e62d92e9d5fbbdb3507bcff5be79462f /application/service
parent0bed4fd5c9f67b60173df6638dc524d7b833c4e1 (diff)
Rework api error handling
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/service')
-rw-r--r--application/service/user.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/application/service/user.php b/application/service/user.php
index d06f78855..97f2531f9 100644
--- a/application/service/user.php
+++ b/application/service/user.php
@@ -26,11 +26,11 @@ class user {
$valid_levels = $CI->muser->get_access_levels();
if (array_search($access_level, $valid_levels) === false) {
- show_error("Invalid access levels requested.");
+ throw new \exceptions\UserInputException("user/validation/access_level/invalid", "Invalid access levels requested.");
}
if (strlen($comment) > 255) {
- show_error("Comment may only be 255 chars long.");
+ throw new \exceptions\UserInputException("user/validation/comment/too-long", "Comment may only be 255 chars long.");
}
$key = random_alphanum(32);