JError/getError: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 49: | Line 49: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=getError | category=getError | ||
category=JError | category=JError | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 01:36, 25 March 2017
Description
Method for retrieving the last exception object in the error stack
<! removed transcluded page call, red link never existed >
Syntax
static getError($unset=false)
| Parameter Name | Default Value | Description |
|---|---|---|
| $unset | false |
Returns
mixed Last exception object in the error stack or boolean false if none exist
Defined in
libraries/joomla/error/error.php
Importing
jimport( 'joomla.error.error' );
Source Body
public static function getError($unset = false)
{
if (!isset(JError::$stack[0])) {
return false;
}
if ($unset) {
$error = array_shift(JError::$stack[0]);
}
else {
$error = &JError::$stack[0];
}
return $error;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples