diff options
author | Florian Pritz <bluewind@xinu.at> | 2014-08-09 18:08:57 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2014-08-29 17:43:19 +0200 |
commit | 3c6b4d9311fb622a5ccf5276a5f551aa9471f803 (patch) | |
tree | adbd1192acaf8ce7982cc50930b46d4583883a89 /application/errors/error_general.php | |
parent | cc72236f71c60396b69631656f8e0ad00a6301c8 (diff) |
Display better errors for CLI requests
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/errors/error_general.php')
-rw-r--r-- | application/errors/error_general.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/application/errors/error_general.php b/application/errors/error_general.php index 6c67fa33f..be495e4f6 100644 --- a/application/errors/error_general.php +++ b/application/errors/error_general.php @@ -2,14 +2,21 @@ // fancy error page only works if we can load helpers if (class_exists("CI_Controller") && !isset($GLOBALS["is_error_page"])) { - $title = "Error"; + if (!isset($title)) { + $title = "Error"; + } $GLOBALS["is_error_page"] = true; $CI =& get_instance(); $CI->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("</p>", "</p>\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("</p>", "</p>\n", $message); $message = strip_tags($message); echo "$heading: $message\n"; exit(); |