API16

JError/handleDie: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m preparing for archive only
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:




<span class="editsection" style="font-size:76%;">
 
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>


<! removed transcluded page call, red link never existed >
<! removed transcluded page call, red link never existed >
Line 61: Line 59:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
<! removed transcluded page call, red link never existed >
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=handleDie
  category=handleDie
  category=JError
  category=JError
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

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