-
Notifications
You must be signed in to change notification settings - Fork 0
Error Layer
defvayne23 edited this page Jan 13, 2012
·
3 revisions
$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.
-
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.
$this->error->send('Product not found.', 404);
$this->error->trigger(string $message[, string $error_type = ERROR[, array $backtrace]]);
Loads the given model.
- 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.
$aTrace = debug_backtrace();
$this->error->trigger('Expected argument 1 should be an object.', 'error', $aTrace[0]);
$this->error->log(string $message[, string $error_type = ERROR]);
Sends the given message into the log.
-
message
Message sent to the log. -
error_type
Log error type. (Error, Notice, Debug, Info)
$this->error->log('Requested product not found.', 'info');