diff options
author | Florian Pritz <bluewind@xinu.at> | 2015-02-03 11:14:29 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-02-03 11:14:29 +0100 |
commit | 9ea78213f8e505b5fde7372106adc1947d1f7de2 (patch) | |
tree | 278d5c4faba72d05c6a2468a37cdc1d3528a66fd /application/controllers/api.php | |
parent | 6816970229c6d0bd46ba46ecd70199c0687952da (diff) |
Improve general exception handling
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/api.php')
-rw-r--r-- | application/controllers/api.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/application/controllers/api.php b/application/controllers/api.php index dc31f47d2..3297f0614 100644 --- a/application/controllers/api.php +++ b/application/controllers/api.php @@ -51,6 +51,9 @@ class Api extends MY_Controller { return send_json_reply($c->$function()); } catch (\exceptions\PublicApiException $e) { return send_json_error_reply($e->get_error_id(), $e->getMessage(), $e->get_data()); + } catch (\Exception $e) { + _log_exception($e); + return send_json_error_reply("internal-error", "An unhandled internal server error occured"); } } } |