format_for_cli(); } else { echo Kohana_Exception::text($e); } $exit_code = $e->getCode(); // Never exit "0" after an exception. if ($exit_code == 0) { $exit_code = 1; } exit($exit_code); } catch (Exception $e) { // Clean the output buffer if one exists ob_get_level() and ob_clean(); // Display the exception text echo Kohana_Exception::text($e), "\n"; // Exit with an error status exit(1); } } public function format_for_cli() { return Kohana_Exception::text($this); } }