JError/handleDie: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Die error handler Echos the error message to output and then dies
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JError/handleDie... |
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 61: | Line 59: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | |||
< | |||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=handleDie | category=handleDie | ||
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
Die error handler Echos the error message to output and then dies
<! removed transcluded page call, red link never existed >
Syntax
static handleDie(&$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 handleDie(& $error, $options)
{
$level_human = JError::translateErrorLevel($error->get('level'));
if (isset ($_SERVER['HTTP_HOST']))
{
// output as html
jexit("<br /><b>J$level_human</b> ".$error->get('message')."<br />\n");
}
else
{
// output as simple text
if (defined('STDERR')) {
fwrite(STDERR, "J$level_human ".$error->get('message')."\n");
}
else {
jexit("J$level_human ".$error->get('message')."\n");
}
}
return $error;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples