| 502 | | if ($line != FALSE) |
| 503 | | { |
| 504 | | // Remove the first entry of debug_backtrace(), it is the exception_handler call |
| 505 | | $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTrace(); |
| 506 | | |
| 507 | | // Beautify backtrace |
| 508 | | $trace = self::backtrace($trace); |
| 509 | | } |
| 510 | | |
| 511 | | // Load the error |
| 512 | | include self::find_file('views', empty($template) ? 'kohana_error_page' : $template); |
| | 498 | // Test if display_errors is on |
| | 499 | if (Config::item('core.display_errors')) |
| | 500 | { |
| | 501 | if ($line != FALSE) |
| | 502 | { |
| | 503 | // Remove the first entry of debug_backtrace(), it is the exception_handler call |
| | 504 | $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTrace(); |
| | 505 | |
| | 506 | // Beautify backtrace |
| | 507 | $trace = self::backtrace($trace); |
| | 508 | } |
| | 509 | |
| | 510 | // Load the error |
| | 511 | include self::find_file('views', empty($template) ? 'kohana_error_page' : $template); |
| | 512 | } |
| | 513 | else |
| | 514 | { |
| | 515 | // Get the i18n messages |
| | 516 | $error = Kohana::lang('core.generic_error'); |
| | 517 | $message = sprintf(Kohana::lang('core.errors_disabled'), url::site(''), url::site(Router::$current_uri)); |
| | 518 | |
| | 519 | // Load the errors_disabled view |
| | 520 | include self::find_file('views', 'kohana_error_disabled'); |
| | 521 | } |