Mercurial > dedupe
comparison Exception/SQLException.cpp @ 82:f507a7240bc9
Functionality for easy clearing of a query when throwing an exception.
| author | Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no> |
|---|---|
| date | Thu, 10 Oct 2013 14:13:01 +0200 |
| parents | c9447697609f |
| children |
comparison
equal
deleted
inserted
replaced
| 81:69a30d9f126e | 82:f507a7240bc9 |
|---|---|
| 10 SQLException::SQLException(const QSqlQuery& errorQuery) : | 10 SQLException::SQLException(const QSqlQuery& errorQuery) : |
| 11 Exception(errorQuery.lastError().text() + ":" + errorQuery.lastQuery()) | 11 Exception(errorQuery.lastError().text() + ":" + errorQuery.lastQuery()) |
| 12 { | 12 { |
| 13 } | 13 } |
| 14 | 14 |
| 15 SQLException::SQLException(QSqlQuery& errorQuery, bool clear) : | |
| 16 Exception(errorQuery.lastError().text() + ":" + errorQuery.lastQuery()) | |
| 17 { | |
| 18 if (clear) | |
| 19 errorQuery.clear(); | |
| 20 } | |
| 21 | |
| 15 void SQLException::raise() const | 22 void SQLException::raise() const |
| 16 { | 23 { |
| 17 throw *this; | 24 throw *this; |
| 18 } | 25 } |
