diff options
author | Florian Pritz <bluewind@xinu.at> | 2015-02-02 19:45:11 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-02-02 19:45:11 +0100 |
commit | 33efe571e3e7ebd607e92345c2e94e7fd8ae27f0 (patch) | |
tree | 6d24b9e3e62d92e9d5fbbdb3507bcff5be79462f /application/service/user.php | |
parent | 0bed4fd5c9f67b60173df6638dc524d7b833c4e1 (diff) |
Rework api error handling
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/service/user.php')
-rw-r--r-- | application/service/user.php | 4 |
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); |