Skip to content

CI_Exceptions

Mathieu Nayrolles edited this page Jan 20, 2016 · 1 revision

CI_Exceptions

Exceptions Class

  • Class name: CI_Exceptions
  • Namespace:

Properties

$ob_level

public integer $ob_level

Nesting level of the output buffering mechanism

  • Visibility: public

$levels

public array $levels = array(E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice')

List of available error levels

  • Visibility: public

Methods

__construct

void CI_Exceptions::__construct()

Class constructor

  • Visibility: public

log_exception

void CI_Exceptions::log_exception(integer $severity, string $message, string $filepath, integer $line)

Exception Logger

Logs PHP generated error messages

  • Visibility: public

Arguments

  • $severity integer - <p>Log level</p>
  • $message string - <p>Error message</p>
  • $filepath string - <p>File path</p>
  • $line integer - <p>Line number</p>

show_404

void CI_Exceptions::show_404(string $page, boolean $log_error)

404 Error Handler

  • Visibility: public

Arguments

  • $page string - <p>Page URI</p>
  • $log_error boolean - <p>Whether to log the error</p>

show_error

string CI_Exceptions::show_error(string $heading, string|array<mixed,string> $message, string $template, integer $status_code)

General Error Page

Takes an error message as input (either as a string or an array) and displays it using the specified template.

  • Visibility: public

Arguments

  • $heading string - <p>Page heading</p>
  • $message string|array<mixed,string> - <p>Error message</p>
  • $template string - <p>Template name</p>
  • $status_code integer - <p>(default: 500)</p>

show_exception

mixed CI_Exceptions::show_exception(\Exception $exception)
  • Visibility: public

Arguments

  • $exception Exception

show_php_error

string CI_Exceptions::show_php_error(integer $severity, string $message, string $filepath, integer $line)

Native PHP error handler

  • Visibility: public

Arguments

  • $severity integer - <p>Error level</p>
  • $message string - <p>Error message</p>
  • $filepath string - <p>File path</p>
  • $line integer - <p>Line number</p>
Clone this wiki locally