JError/handleMessage: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Message error handler Enqueues the error message into the system queue
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JError/hand... |
m preparing for archive only |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 4: | Line 4: | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 19: | Line 17: | ||
!Description | !Description | ||
|- | |- | ||
| | | &$error | ||
| | | | ||
| $error object to handle | | $error object to handle | ||
| Line 47: | Line 45: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | |||
< | |||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=handleMessage | category=handleMessage | ||
category=JError | category=JError | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API16]] | |||
Latest revision as of 01:36, 25 March 2017
Description
Message error handler Enqueues the error message into the system queue
<! removed transcluded page call, red link never existed >
Syntax
static handleMessage(&$error, $options)
| Parameter Name | Default Value | Description |
|---|---|---|
| &$error | $error object to handle | |
| $options | $options Handler options |
Returns
object The exception object
Defined in
libraries/joomla/error/error.php
Importing
jimport( 'joomla.error.error' );
Source Body
public static function handleMessage(& $error, $options)
{
$appl = JFactory::getApplication();
$type = ($error->get('level') == E_NOTICE) ? 'notice' : 'error';
$appl->enqueueMessage($error->get('message'), $type);
return $error;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples