From 33efe571e3e7ebd607e92345c2e94e7fd8ae27f0 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 2 Feb 2015 19:45:11 +0100 Subject: Rework api error handling Signed-off-by: Florian Pritz --- application/service/user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application/service') 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); -- cgit v1.2.3-24-g4f1b