Permalink
Browse files

nicer error reporting

  • Loading branch information...
1 parent 55d8d16 commit 15df989f725a2515e4ff43e2abe360d207cc73a2 @shish committed Mar 31, 2012
Showing with 9 additions and 2 deletions.
  1. +1 −1 core/database.class.php
  2. +8 −1 core/util.inc.php
View
@@ -349,7 +349,7 @@ public function execute($query, $args=array()) {
return $stmt;
}
catch(PDOException $pdoe) {
- throw new SCoreException($pdoe->getMessage()."<p>Query: ".$query);
+ throw new SCoreException($pdoe->getMessage()."<p><b>Query:</b> ".$query);
}
}
View
@@ -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>
';

0 comments on commit 15df989

Please sign in to comment.