Include an error message in the exception when a database query fails.

develop
Sven Slootweg 11 years ago
parent bfadf150b4
commit 4b02357739

@ -108,7 +108,8 @@ class CachedPDO extends PDO
else
{
/* The query failed. */
throw new DatabaseException("The query failed.", 0, null, array('query' => $query, 'parameters' => $parameters));
$err = $statement->errorInfo();
throw new DatabaseException("The query failed: {$err[2]}", 0, null, array('query' => $query, 'parameters' => $parameters));
}
}

Loading…
Cancel
Save