private function getMessage(\Exception $exception)
 {
     if ($exception instanceof \ErrorException) {
         return ErrorHandler::getErrNoString($exception->getSeverity()) . ' - ' . $exception->getMessage();
     }
     return $exception->getMessage();
 }
Exemplo n.º 2
0
 private static function getHtmlMessage($errno, $errstr, $errfile, $errline, $trace)
 {
     $trace = Log::$debugBacktraceForTests ?: $trace;
     $message = ErrorHandler::getErrNoString($errno) . ' - ' . $errstr;
     $html = "<p>There is an error. Please report the message (Piwik " . (class_exists('Piwik\\Version') ? Version::VERSION : '') . ")\n        and full backtrace in the <a href='?module=Proxy&action=redirect&url=http://forum.piwik.org' target='_blank'>Piwik forums</a> (please do a Search firit might have been reported already!).</p>";
     $html .= "<p><strong>{$message}</strong> in <em>{$errfile}</em>";
     $html .= " on line {$errline}</p>";
     $html .= "Backtrace:<pre>";
     $html .= str_replace("\n", "\n", $trace);
     $html .= "</pre>";
     return $html;
 }