nicer error reporting

This commit is contained in:
Shish 2012-03-31 17:07:11 +01:00
parent 55d8d16ee8
commit 15df989f72
2 changed files with 9 additions and 2 deletions

View file

@ -349,7 +349,7 @@ class Database {
return $stmt;
}
catch(PDOException $pdoe) {
throw new SCoreException($pdoe->getMessage()."<p>Query: ".$query);
throw new SCoreException($pdoe->getMessage()."<p><b>Query:</b> ".$query);
}
}

View file

@ -1094,7 +1094,13 @@ function _load_extensions() {
function _fatal_error(Exception $e) {
$version = VERSION;
$message = $e->getMessage();
//$trace = var_dump($e->getTrace());
//$hash = exec("git rev-parse HEAD");
//$h_hash = $hash ? "<p><b>Hash:</b> $hash" : "";
//'.$h_hash.'
header("HTTP/1.0 500 Internal Error");
echo '
<html>
@ -1103,7 +1109,8 @@ function _fatal_error(Exception $e) {
</head>
<body>
<h1>Internal Error</h1>
<p>'.$message.'
<p><b>Message:</b> '.$message.'
<p><b>Version:</b> '.$version.'
</body>
</html>
';