Show the last error a bit more clearly if available

This commit is contained in:
Sean Harvey 2012-12-19 11:39:51 +13:00
parent f64c662124
commit e527665c5c

View File

@ -214,7 +214,8 @@ class MSSQLDatabase extends SS_Database {
* Throw a database error
*/
function databaseError($message, $errorLevel = E_USER_ERROR) {
$message .= "\n" . $this->getLastError();
$lastError = $this->getLastError();
if($lastError) $message .= "\nLast error: " . $lastError;
return parent::databaseError($message, $errorLevel);
}