API16

JError/getError: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m clean up
Line 2: Line 2:
Method for retrieving the last exception object in the error stack
Method for retrieving the last exception object in the error stack


<span class="editsection" style="font-size:76%;">
 
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>


<! removed transcluded page call, red link never existed >
<! removed transcluded page call, red link never existed >
Line 47: Line 45:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
<! removed transcluded page call, red link never existed >
<! removed transcluded page call, red link never existed >



Revision as of 13:56, 24 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

<CodeExamplesForm />