Skip to content

Commit

Permalink
Update system/core/Common.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dionysiosarvanitis committed Oct 4, 2012
1 parent 6bd4bf2 commit bfadc74
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions system/core/Common.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -547,43 +547,43 @@ function _error_handler($severity, $message, $filepath, $line)
if ( ! function_exists('_exception_handler')) if ( ! function_exists('_exception_handler'))
{ {
/** /**
* Default Exception Handler * Default Exception Handler
* Triggers on uncaught exceptions * Triggers on uncaught exceptions
* *
* @access private * @access private
* @return void * @return void
*/ */
function _exception_handler($exception) function _exception_handler($exception)
{ {
$heading = $exception->getHeading(); $heading = $exception->getHeading();
$message = $exception->getMessage(); $message = $exception->getMessage();


parent::log_exception(E_ERROR, $message, $exception->getFile(), $exception->getLine()); parent::log_exception(E_ERROR, $message, $exception->getFile(), $exception->getLine());


set_status_header($exception->getStatus()); set_status_header($exception->getStatus());


$_input =& load_class('Input'); $_input =& load_class('Input');

if ($_input->is_ajax_request()) if ($_input->is_ajax_request())
{ {
echo $message; echo $message;
} }
else else
{ {
if (ob_get_level() > $this->ob_level + 1) if (ob_get_level() > $this->ob_level + 1)
{ {
ob_end_flush(); ob_end_flush();
} }
ob_start(); ob_start();
include(APPPATH.'errors/'.$exception->getTemplate().'.php'); include(APPPATH.'errors/'.$exception->getTemplate().'.php');
$buffer = ob_get_contents(); $buffer = ob_get_contents();
ob_end_clean(); ob_end_clean();


echo $buffer; echo $buffer;
} }

exit; exit;
} }
} }


// -------------------------------------------------------------------- // --------------------------------------------------------------------
Expand Down

0 comments on commit bfadc74

Please sign in to comment.