JError: Difference between revisions
From Joomla! Documentation
New page: <span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>
{{Description:JError}}
===Defined in===
librari... |
m clean up |
||
| Line 1: | Line 1: | ||
[[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. | |||
===Defined in=== | ===Defined in=== | ||
| Line 105: | Line 102: | ||
<source lang="php">jimport( 'joomla.error.error' );</source> | <source lang="php">jimport( 'joomla.error.error' );</source> | ||
{{subst:SeeAlso:JError}} | |||
{{SeeAlso:JError}} | |||
===Examples=== | ===Examples=== | ||
Revision as of 13:56, 24 March 2017
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.
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' );
{{subst:SeeAlso:JError}}
Examples
<CodeExamplesForm />