JError: Difference between revisions
From Joomla! Documentation
No edit summary |
m →See also: preparing for archive only |
||
| (7 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | {{deprecated|when=1.5|from=2.5,11.1|old=JError|link=Exceptions and Logging in Joomla 1.7 and Joomla Platform 11.1|new=PHP exceptions instead}}__NOTOC__ | ||
=={{JVer|11.1}} JError== | =={{JVer|11.1}} JError== | ||
===Description=== | ===Description=== | ||
[[JError]] is inspired in design and concept by patErrorManager [http://www.php-tools.net]. It is Joomla's Error Handling Class and should be used by third party developers to handle errors. | |||
===Note=== | ===Note=== | ||
JError is deprecated use PHP exceptions instead | JError is deprecated use PHP exceptions instead | ||
| Line 17: | Line 15: | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::addToStack | |[[API17:JError::addToStack|addToStack]] | ||
|Method to add non-JError thrown JExceptions to the stack for debugging purposes. | |Method to add non-JError thrown JExceptions to the stack for debugging purposes. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::attachHandler | |[[API17:JError::attachHandler|attachHandler]] | ||
|Method that attaches the error handler to . | |Method that attaches the error handler to . | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::customErrorHandler | |[[API17:JError::customErrorHandler|customErrorHandler]] | ||
| | | | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::customErrorPage | |[[API17:JError::customErrorPage|customErrorPage]] | ||
|Display a custom error page and exit gracefully. | |Display a custom error page and exit gracefully. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::detachHandler | |[[API17:JError::detachHandler|detachHandler]] | ||
|Method that detaches the error handler from . | |Method that detaches the error handler from . | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::getError | |[[API17:JError::getError|getError]] | ||
|Method for retrieving the last exception object in the error stack. | |Method for retrieving the last exception object in the error stack. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::getErrorHandling | |[[API17:JError::getErrorHandling|getErrorHandling]] | ||
|Method to get the current error handler settings for a specified error level. | |Method to get the current error handler settings for a specified error level. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::getErrors | |[[API17:JError::getErrors|getErrors]] | ||
|Method for retrieving the exception stack. | |Method for retrieving the exception stack. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::handleCallback | |[[API17:JError::handleCallback|handleCallback]] | ||
|Callback error handler | |Callback error handler | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::handleDie | |[[API17:JError::handleDie|handleDie]] | ||
|Die error handler | |Die error handler | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::handleEcho | |[[API17:JError::handleEcho|handleEcho]] | ||
|Echo error handler | |Echo error handler | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::handleIgnore | |[[API17:JError::handleIgnore|handleIgnore]] | ||
|Ignore error handler | |Ignore error handler | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::handleLog | |[[API17:JError::handleLog|handleLog]] | ||
|Log error handler | |Log error handler | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::handleMessage | |[[API17:JError::handleMessage|handleMessage]] | ||
|Message error handler | |Message error handler | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::handleVerbose | |[[API17:JError::handleVerbose|handleVerbose]] | ||
|Verbose error handler | |Verbose error handler | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::isError | |[[API17:JError::isError|isError]] | ||
|Method to determine if a value is an exception object. | |Method to determine if a value is an exception object. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::raise | |[[API17:JError::raise|raise]] | ||
|Create a new object given the passed arguments. | |Create a new object given the passed arguments. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::raiseError | |[[API17:JError::raiseError|raiseError]] | ||
|Wrapper method for the method with predefined error level of E_ERROR and backtrace set to true. | |Wrapper method for the method with predefined error level of E_ERROR and backtrace set to true. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::raiseNotice | |[[API17:JError::raiseNotice|raiseNotice]] | ||
|Wrapper method for the method with predefined error level of E_NOTICE and backtrace set to false. | |Wrapper method for the method with predefined error level of E_NOTICE and backtrace set to false. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::raiseWarning | |[[API17:JError::raiseWarning|raiseWarning]] | ||
|Wrapper method for the method with predefined error level of E_WARNING and backtrace set to false. | |Wrapper method for the method with predefined error level of E_WARNING and backtrace set to false. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::registerErrorLevel | |[[API17:JError::registerErrorLevel|registerErrorLevel]] | ||
|Method to register a new error level for handling errors. | |Method to register a new error level for handling errors. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::renderBacktrace | |[[API17:JError::renderBacktrace|renderBacktrace]] | ||
| | | | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::setErrorHandling | |[[API17:JError::setErrorHandling|setErrorHandling]] | ||
|Method to set the way the will handle different error levels. | |Method to set the way the will handle different error levels. | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::throwError | |[[API17:JError::throwError|throwError]] | ||
| | | | ||
|- | |- | ||
|public static | |public static | ||
|[[JError::translateErrorLevel | |[[API17:JError::translateErrorLevel|translateErrorLevel]] | ||
|Translate an error level integer to a human readable string e.g. | |Translate an error level integer to a human readable string e.g. | ||
|- | |- | ||
| Line 129: | Line 127: | ||
===See also=== | ===See also=== | ||
* {{JVer|11.1}} '''JError source code''' on [[jplatform:error/error.php|BitBucket]] | * {{JVer|11.1}} '''JError source code''' on [[jplatform:error/error.php|BitBucket]] | ||
* {{JVer|11.1}} Subpackage [[Subpackage Error | * {{JVer|11.1}} Subpackage [[API17:Subpackage Error|Error]] | ||
* [[JError|Other versions of JError]] | * [[API17:JError|Other versions of JError]] | ||
* [[Display_error_messages_and_notices|Display error messages and notices]] | |||
===User contributed notes=== | |||
===User | |||
Latest revision as of 02:57, 25 March 2017
JError
Description
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.
Note
JError is deprecated use PHP exceptions instead
Methods
| Visibility | Method name | Description |
|---|---|---|
| public static | addToStack | Method to add non-JError thrown JExceptions to the stack for debugging purposes. |
| public static | attachHandler | Method that attaches the error handler to . |
| public static | customErrorHandler | |
| public static | customErrorPage | Display a custom error page and exit gracefully. |
| public static | detachHandler | Method that detaches the error handler from . |
| public static | getError | Method for retrieving the last exception object in the error stack. |
| public static | getErrorHandling | Method to get the current error handler settings for a specified error level. |
| public static | getErrors | Method for retrieving the exception stack. |
| public static | handleCallback | Callback error handler |
| public static | handleDie | Die error handler |
| public static | handleEcho | Echo error handler |
| public static | handleIgnore | Ignore error handler |
| public static | handleLog | Log error handler |
| public static | handleMessage | Message error handler |
| public static | handleVerbose | Verbose error handler |
| public static | isError | Method to determine if a value is an exception object. |
| public static | raise | Create a new object given the passed arguments. |
| public static | raiseError | Wrapper method for the method with predefined error level of E_ERROR and backtrace set to true. |
| public static | raiseNotice | Wrapper method for the method with predefined error level of E_NOTICE and backtrace set to false. |
| public static | raiseWarning | Wrapper method for the method with predefined error level of E_WARNING and backtrace set to false. |
| public static | registerErrorLevel | Method to register a new error level for handling errors. |
| public static | renderBacktrace | |
| public static | setErrorHandling | Method to set the way the will handle different error levels. |
| public static | throwError | |
| public static | translateErrorLevel | Translate an error level integer to a human readable string e.g. |
- Defined in libraries/joomla/error/error.php
Importing
jimport( 'joomla.error.error' );
See also
JError source code on BitBucket
Subpackage Error- Other versions of JError
- Display error messages and notices