Skip to content
defvayne23 edited this page Jan 13, 2012 · 3 revisions

send()

Description

$this->error->send(string $message[, string $error_code = 500 [, bool $log = true [, string $header = 'An Error Was Encountered']]]);

Sends an error to the application. If in development it will show the error, if in production will display the corresponding error template. If logging is turned on and argument doesn't say otherwise it will log the error.

Parameters

  • message
    Error message that is sent to the application.
  • error_code
    Error header number for the error. (ex. 404, 500, ...)
  • log
    Sets if the error should be sent to the log or now.
  • header
    Text that should be shown on the error page, if application is in production.

Examples

$this->error->send('Product not found.', 404);

trigger()

Description

$this->error->trigger(string $message[, string $error_type = ERROR[, array $backtrace]]);

Loads the given model.

Parameters

  • message<brError message that is sent to the application.
  • error_type
    Error type. (Error, Notice, Debug, Info)
  • backtrace
    Send the debug_backtrace() of where the error should be explained as triggered from.

Examples

$aTrace = debug_backtrace();
$this->error->trigger('Expected argument 1 should be an object.', 'error', $aTrace[0]);

log()

Description

$this->error->log(string $message[, string $error_type = ERROR]);

Sends the given message into the log.

Parameters

  • message
    Message sent to the log.
  • error_type
    Log error type. (Error, Notice, Debug, Info)

Examples

$this->error->log('Requested product not found.', 'info');

< Back to Index

Clone this wiki locally