Actions

API16

JError

From Joomla! Documentation

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[Edit Descripton] JError is inspired in design and concept by patErrorManager [1]. It is Joomla's Error Handling Class and should be used by third party developers to handle errors.

Contents

Defined in

libraries/joomla/error/error.php

Methods

Method name Description
isError Method to determine if a value is an exception object. This check supports both JException and PHP5 Exception objects
getError Method for retrieving the last exception object in the error stack
getErrors Method for retrieving the exception stack
addToStack Method to add non-JError thrown JExceptions to the JError stack for debugging purposes
raise Create a new JException object given the passed arguments
throwError
raiseError Wrapper method for the raise() method with predefined error level of E_ERROR and backtrace set to true.
raiseWarning Wrapper method for the raise() method with predefined error level of E_WARNING and backtrace set to false.
raiseNotice Wrapper method for the raise() method with predefined error level of E_NOTICE and backtrace set to false.
getErrorHandling Method to get the current error handler settings for a specified error level.
setErrorHandling Method to set the way the JError will handle different error levels. Use this if you want to override the default settings.
attachHandler Method that attaches the error handler to JError
detachHandler Method that dettaches the error handler from JError
registerErrorLevel Method to register a new error level for handling errors
translateErrorLevel Translate an error level integer to a human readable string e.g. E_ERROR will be translated to 'Error'
handleIgnore Ignore error handler

Ignores the error

handleEcho Echo error handler

Echos the error message to output

handleVerbose Verbose error handler

Echos the error message to output as well as related info

handleDie Die error handler

Echos the error message to output and then dies

handleMessage Message error handler

Enqueues the error message into the system queue

handleLog Log error handler

Logs the error message to a system log file

handleCallback Callback error handler

Send the error object to a callback method for error handling

customErrorPage Display a custom error page and exit gracefully
customErrorHandler
renderBacktrace

Importing

jimport( 'joomla.error.error' );

[Edit See Also] SeeAlso:JError

Examples

<CodeExamplesForm />