diff options
author | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-23 16:10:55 +0200 |
---|---|---|
committer | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-23 16:10:55 +0200 |
commit | 7b2d4874b7bd992ef3f09124b7ebbc346eba01f4 (patch) | |
tree | 82d62057cf9cae9b4a1fca46f9f30693d92a3f6e /lib/Plugins/SQLite3.cpp | |
parent | 4fa35669bd72794b1acae57c98e57297d9e65794 (diff) | |
download | abrt-7b2d4874b7bd992ef3f09124b7ebbc346eba01f4.tar.gz abrt-7b2d4874b7bd992ef3f09124b7ebbc346eba01f4.tar.xz abrt-7b2d4874b7bd992ef3f09124b7ebbc346eba01f4.zip |
added new abrt exceptions
Diffstat (limited to 'lib/Plugins/SQLite3.cpp')
-rw-r--r-- | lib/Plugins/SQLite3.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Plugins/SQLite3.cpp b/lib/Plugins/SQLite3.cpp index 9a5c6e0..13a0ed6 100644 --- a/lib/Plugins/SQLite3.cpp +++ b/lib/Plugins/SQLite3.cpp @@ -25,7 +25,7 @@ #include <string> #include <iostream> #include "PluginSettings.h" - +#include "ABRTException.h" #define ABRT_TABLE "abrt" #define SQLITE3_MASTER_TABLE "sqlite_master" @@ -54,7 +54,7 @@ void CSQLite3::Exec(const std::string& pCommand) int ret = sqlite3_exec(m_pDB, pCommand.c_str(), 0, 0, &err); if (ret != SQLITE_OK) { - throw std::string("SQLite3::Exec(): Error on: " + pCommand + " " + err); + throw CABRTException(EXCEP_PLUGIN, "SQLite3::Exec(): Error on: " + pCommand + " " + err); } } @@ -66,7 +66,7 @@ void CSQLite3::GetTable(const std::string& pCommand, vector_database_rows_t& pTa int ret = sqlite3_get_table(m_pDB, pCommand.c_str(), &table, &nrow, &ncol, &err); if (ret != SQLITE_OK) { - throw std::string("SQLite3::GetTable(): Error on: " + pCommand + " " + err); + throw CABRTException(EXCEP_PLUGIN, "SQLite3::GetTable(): Error on: " + pCommand + " " + err); } pTable.clear(); int ii; @@ -122,7 +122,7 @@ bool CSQLite3::OpenDB() if (ret != SQLITE_OK && ret != SQLITE_CANTOPEN) { - throw std::string("SQLite3::CheckDB(): Could not open database. ") + sqlite3_errmsg(m_pDB); + throw CABRTException(EXCEP_PLUGIN, std::string("SQLite3::CheckDB(): Could not open database. ") + sqlite3_errmsg(m_pDB)); } return ret == SQLITE_OK; } @@ -135,7 +135,7 @@ void CSQLite3::CreateDB() NULL); if(ret != SQLITE_OK) { - throw std::string("SQLite3::Create(): Could not create database. ") + sqlite3_errmsg(m_pDB); + throw CABRTException(EXCEP_PLUGIN, std::string("SQLite3::Create(): Could not create database. ") + sqlite3_errmsg(m_pDB)); } } @@ -208,7 +208,7 @@ void CSQLite3::Delete(const std::string& pUUID, const std::string& pUID) } else { - throw std::string("CSQLite3::Delete(): UUID is not found in DB."); + throw CABRTException(EXCEP_PLUGIN, "CSQLite3::Delete(): UUID is not found in DB."); } } @@ -223,7 +223,7 @@ void CSQLite3::SetReported(const std::string& pUUID, const std::string& pUID) } else { - throw std::string("CSQLite3::SetReported(): UUID is not found in DB."); + throw CABRTException(EXCEP_PLUGIN, "CSQLite3::SetReported(): UUID is not found in DB."); } } |