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/controllers/api/v1/file.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application/controllers/api/v1/file.php') diff --git a/application/controllers/api/v1/file.php b/application/controllers/api/v1/file.php index 56455c01e..c291ae879 100644 --- a/application/controllers/api/v1/file.php +++ b/application/controllers/api/v1/file.php @@ -24,12 +24,12 @@ class file extends \controllers\api\api_controller { $files = getNormalizedFILES(); if (empty($files)) { - show_error("No file was uploaded or unknown error occured."); + throw new \exceptions\PublicApiException("file/no-file", "No file was uploaded or unknown error occured."); } $errors = \service\files::verify_uploaded_files($files); if (!empty($errors)) { - return send_json_error_reply("file/upload-verify-failed", "Failed to verify uploaded file", $errors); + throw new \exceptions\PublicApiException("file/upload-verify-failed", "Failed to verify uploaded file", $errors); } $limits = $this->muser->get_upload_id_limits(); -- cgit v1.2.3-24-g4f1b