From 3c6b4d9311fb622a5ccf5276a5f551aa9471f803 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 9 Aug 2014 18:08:57 +0200 Subject: Display better errors for CLI requests Signed-off-by: Florian Pritz --- application/errors/error_404.php | 65 ++---------------------------------- application/errors/error_db.php | 65 ++---------------------------------- application/errors/error_general.php | 10 +++++- 3 files changed, 15 insertions(+), 125 deletions(-) diff --git a/application/errors/error_404.php b/application/errors/error_404.php index 792726a67..cfe923d63 100644 --- a/application/errors/error_404.php +++ b/application/errors/error_404.php @@ -1,62 +1,3 @@ - - - -404 Page Not Found - - - -
-

- -
- - \ No newline at end of file + - - -Database Error - - - -
-

- -
- - \ No newline at end of file +load->helper("filebin"); $CI->load->helper("url"); + if ($CI->input->is_cli_request()) { + is_cli_client(true); + } + if (static_storage("response_type") == "json") { + $message = str_replace("

", "

\n", $message); $array = array( "status" => "error", "message" => strip_tags($message), @@ -20,6 +27,7 @@ if (class_exists("CI_Controller") && !isset($GLOBALS["is_error_page"])) { } if (is_cli_client()) { + $message = str_replace("

", "

\n", $message); $message = strip_tags($message); echo "$heading: $message\n"; exit(); -- cgit v1.2.3-24-g4f1b