Skip to content

Commit

Permalink
nicer error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Mar 31, 2012
1 parent 55d8d16 commit 15df989
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/database.class.php
Expand Up @@ -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);
}
}

Expand Down
9 changes: 8 additions & 1 deletion core/util.inc.php
Expand Up @@ -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>
Expand All @@ -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>
';
Expand Down

0 comments on commit 15df989

Please sign in to comment.