Example #1
0
 /**
  * handleError: die
  * display error-message and die
  *
  * @access private
  * @param object $error patError-Object
  * @param array $options options for handler
  * @return object $error error-object
  * @see raise()
  */
 function &handleErrorDie(&$error, $options)
 {
     $level_human = patErrorManager::translateErrorLevel($error->getLevel());
     if (isset($_SERVER['HTTP_HOST'])) {
         // output as html
         jexit("<br /><b>pat-{$level_human}</b> " . $error->getMessage() . "<br />\n");
     } else {
         // output as simple text
         if (defined('STDERR')) {
             fwrite(STDERR, "pat-{$level_human} " . $error->getMessage() . "\n");
         } else {
             jexit("pat-{$level_human} " . $error->getMessage() . "\n");
         }
     }
     return $error;
 }