From 7b2d4874b7bd992ef3f09124b7ebbc346eba01f4 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Thu, 23 Apr 2009 16:10:55 +0200 Subject: added new abrt exceptions --- lib/Plugins/CCpp.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lib/Plugins/CCpp.cpp') diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 76571f3..286f730 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -20,9 +20,10 @@ */ #include "CCpp.h" -#include +#include "ABRTException.h" #include "DebugDump.h" #include "PluginSettings.h" +#include #include #include #include @@ -70,7 +71,7 @@ std::string CAnalyzerCCpp::CreateHash(const std::string& pInput) hc = HASH_Create(HASH_AlgSHA1); if (!hc) { - throw std::string("CAnalyzerCCpp::CreateHash(): cannot initialize hash."); + throw CABRTException(EXCEP_PLUGIN, "CAnalyzerCCpp::CreateHash(): cannot initialize hash."); } HASH_Begin(hc); HASH_Update(hc, reinterpret_cast(pInput.c_str()), pInput.length()); @@ -104,7 +105,7 @@ void CAnalyzerCCpp::InstallDebugInfos(const std::string& pPackage) m_Pid = child; if (child < 0) { - throw std::string("CAnalyzerCCpp::RunGdb(): fork failed."); + throw CABRTException(EXCEP_PLUGIN, "CAnalyzerCCpp::RunGdb(): fork failed."); } if (child == 0) { @@ -164,7 +165,7 @@ void CAnalyzerCCpp::InstallDebugInfos(const std::string& pPackage) close(pipeout[0]); kill(child, SIGTERM); wait(NULL); - throw std::string("CAnalyzerCCpp::InstallDebugInfos(): cannot install debuginfos for ") + pPackage; + throw CABRTException(EXCEP_PLUGIN, "CAnalyzerCCpp::InstallDebugInfos(): cannot install debuginfos for " + pPackage); } if (strstr(buff, "Total download size") != NULL) { @@ -175,7 +176,7 @@ void CAnalyzerCCpp::InstallDebugInfos(const std::string& pPackage) close(pipeout[0]); kill(child, SIGTERM); wait(NULL); - throw std::string("CAnalyzerCCpp::InstallDebugInfos(): cannot install debuginfos for ") + pPackage; + throw CABRTException(EXCEP_PLUGIN, "CAnalyzerCCpp::InstallDebugInfos(): cannot install debuginfos for " + pPackage); } } } @@ -211,7 +212,7 @@ void CAnalyzerCCpp::GetBacktrace(const std::string& pDebugDumpDir, std::string& } else { - throw "CAnalyzerCCpp::GetBacktrace(): cannot create gdb script " + tmpFile ; + throw CABRTException(EXCEP_PLUGIN, "CAnalyzerCCpp::GetBacktrace(): cannot create gdb script " + tmpFile); } char* command = (char*)"gdb"; char* args[5] = { (char*)"gdb", (char*)"-batch", (char*)"-x", NULL, NULL }; @@ -361,7 +362,7 @@ void CAnalyzerCCpp::ExecVP(const char* pCommand, char* const pArgs[], const std: m_Pid = child; if (child == -1) { - throw std::string("CAnalyzerCCpp::RunGdb(): fork failed."); + CABRTException(EXCEP_PLUGIN, "CAnalyzerCCpp::RunGdb(): fork failed."); } if(child == 0) { @@ -497,7 +498,7 @@ void CAnalyzerCCpp::Init() } if (NSS_NoDB_Init(NULL) != SECSuccess) { - throw std::string("CAnalyzerCCpp::CreateHash(): cannot initialize NSS library."); + throw CABRTException(EXCEP_PLUGIN, "CAnalyzerCCpp::CreateHash(): cannot initialize NSS library."); } } -- cgit