Ejemplo n.º 1
0
 /**
  * Static since a store config exception (caused by a module config error) cannot call magento's model objects.
  * If a store config exception occurs, the exception class logs it drect.
  * 
  * @param type $e
  */
 public static function pushEvent($e, $setAppName = true)
 {
     if (extension_loaded('newrelic')) {
         $message = $e->getMessage();
         $message = empty($message) ? get_class($e) : $message;
         if ($setAppName) {
             Mage::Helper('newrelic')->setAppName();
         }
         newrelic_notice_error($message, $e);
     }
 }
Ejemplo n.º 2
0
/**
 * Exception handler.
 *
 * @global type $document
 * @global array $totalFailure
 * @global boolean $responding
 * @global type $standalone
 * @param type $e
 */
function handleReqException($e)
{
    global $document, $totalFailure, $responding, $standalone;
    $responding = true;
    $message = 'Exception: "' . $e->getMessage() . '" in ' . $e->getFile() . ' L' . $e->getLine() . "\n";
    foreach ($e->getTrace() as $stackLevel) {
        $message .= $stackLevel['file'] . ' L' . $stackLevel['line'] . ' ';
        if ($stackLevel['class'] != '') {
            $message .= $stackLevel['class'];
            $message .= '->';
        }
        $message .= $stackLevel['function'];
        $message .= "();\n";
    }
    $message = str_replace('{scenario}', 'uncaught exception', $totalFailure[0] . $message . $totalFailure[1]);
    echo strtr($document, array('{headerContent}' => '', '{bodyContent}' => $message));
    RIP();
}
Ejemplo n.º 3
0
/**
 * 异常处理
 * @param type $e
 */
function exception_error($e)
{
    echo $e->getMessage();
}
 /**
  * Error handler
  *
  * @param type $err
  */
 function error($err)
 {
     print_r($err->getMessage());
 }
 /**
  * Exception Handler
  * 
  * @internal
  * @static
  * @param type $exception 
  */
 public static function catch_exception($exception)
 {
     argent_logger::log_event('Exception', $exception->getMessage());
     echo "Argent Exception: " . $exception->getMessage();
 }
Ejemplo n.º 6
0
 /**
  *
  *
  * @param type $trace
  * @param type $error
  */
 public static function error($trace, $error)
 {
     echo '<br>' . '<b>Fatal error</b>: ' . $error->getMessage() . ' in method <strong>' . $trace[0]['function'] . '</strong> ' . 'called at <strong>' . $trace[0]['file'] . '</strong> on line <strong>' . $trace[0]['line'] . '</strong>' . "<br>";
     die;
 }
Ejemplo n.º 7
0
 /**
  * 异常数据报错
  * @param type $e
  */
 protected function errorAction($e, array $config, $action = 'execute')
 {
     $error = $this->PDOStatement->errorInfo();
     //记录日志报错情况[]
     $this->logWrite($e->getCode() . ":" . $e->getMessage());
     if ($error[1] == 2006 || $error[1] == 2013) {
         $this->_linkcount++;
         //重连次数+1
         if ($this->_linkcount < $this->_linkCount) {
             //服务器重连接
             $this->resetConnect();
             return $this->{$action}($config[0], $config[1]);
         } else {
             return false;
         }
     }
 }