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/controllers/api/v1/file.php | |
parent | 0bed4fd5c9f67b60173df6638dc524d7b833c4e1 (diff) |
Rework api error handling
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/api/v1/file.php')
-rw-r--r-- | application/controllers/api/v1/file.php | 4 |
1 files changed, 2 insertions, 2 deletions
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(); |