Table of Contents

getErrors

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Utilities Class JError Method getErrors Reference getErrors() Never Work in Progress

Retrieves the errors that are stored. This function returns a chronological array of errors that have been stored during script execution. Storing errors is one of multiple methods. See the setErrorHandling method for more information.

Syntax

array getErrors ()

Examples

Example

JError::setErrorHandling( E_ALL, 'store' );
JError::raiseNotice( '253', 'THIS IS ONLY A TEST!' );
$errors = JError::getErrors();
foreach ($errors as $error) {
    echo $error->message;
}

might produce:

Result

THIS IS ONLY A TEST!