diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-06-17 15:50:36 -0500 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-06-19 01:08:03 +0200 |
commit | a38797c8c9208fcf6d5cc973d43b555266906af4 (patch) | |
tree | 35d599ba023a5d2a8b515c24bf6bea7d168cda85 | |
parent | 47ce19e28b53c644fd644b2fd18531d0495aca1f (diff) | |
download | kbarcode-a38797c8c9208fcf6d5cc973d43b555266906af4.tar.gz kbarcode-a38797c8c9208fcf6d5cc973d43b555266906af4.zip |
Enhance database error reporting
(cherry picked from commit ba10527d0e0140e8a23cf342e984b2b557a50c21)
-rw-r--r-- | kbarcode/sqltables.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kbarcode/sqltables.cpp b/kbarcode/sqltables.cpp index 9c4aec7..5efae3c 100644 --- a/kbarcode/sqltables.cpp +++ b/kbarcode/sqltables.cpp @@ -269,9 +269,10 @@ bool SqlTables::newTables( const TQString & username, const TQString & password, TQSqlDatabase::removeDatabase( database ); KMessageBox::information( 0, i18n("Created table ")+database+i18n(" successfully!") ); } else { + TQSqlError dbError = dbase->lastError(); dbase->close(); TQSqlDatabase::removeDatabase(drivers[driver]->initdb( database )); - KMessageBox::sorry( 0, i18n("Can't connect to database.") ); + KMessageBox::sorry(0, i18n("Can't connect to database.") + "\n" + dbError.driverText() + "\n" + dbError.databaseText()); return false; } |