diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-06 17:50:26 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-06 17:50:26 +0100 |
commit | b1336faa48bee2cdb7ef0486a5a4faa5c74f4fa7 (patch) | |
tree | a86ee9bbd505b68d57a189418df152d48a1e852d /src/Daemon | |
parent | 3a62ede25114452938acb8e1a67006633b139efc (diff) | |
download | abrt-b1336faa48bee2cdb7ef0486a5a4faa5c74f4fa7.tar.gz abrt-b1336faa48bee2cdb7ef0486a5a4faa5c74f4fa7.tar.xz abrt-b1336faa48bee2cdb7ef0486a5a4faa5c74f4fa7.zip |
make exception handling lighter
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Daemon')
-rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 2 | ||||
-rw-r--r-- | src/Daemon/Daemon.cpp | 4 | ||||
-rw-r--r-- | src/Daemon/MiddleWare.cpp | 26 | ||||
-rw-r--r-- | src/Daemon/PluginManager.cpp | 5 |
4 files changed, 17 insertions, 20 deletions
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 925844e9..ed7e3858 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -286,7 +286,7 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply) catch (CABRTException &e) { dbus_message_unref(reply); - reply = dbus_message_new_error(call, DBUS_ERROR_FAILED, e.what().c_str()); + reply = dbus_message_new_error(call, DBUS_ERROR_FAILED, e.what()); if (!reply) die_out_of_memory(); send_flush_and_unref(reply); diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index b417cfd4..c6d0a029 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -415,7 +415,7 @@ static void FindNewDumps(const char* pPath) { throw e; } - error_msg("%s", e.what().c_str()); + error_msg("%s", e.what()); } } } @@ -883,7 +883,7 @@ int main(int argc, char** argv) } catch (CABRTException& e) { - error_msg("Error: %s", e.what().c_str()); + error_msg("Error: %s", e.what()); } catch (std::exception& e) { diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index abf13814..3f26ab09 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -236,7 +236,7 @@ mw_result_t CreateCrashReport(const char *pUUID, } catch (CABRTException& e) { - warn_client("CreateCrashReport(): " + e.what()); + warn_client(e.what()); if (e.type() == EXCEP_DD_OPEN) { return MW_ERROR; @@ -266,8 +266,8 @@ void RunAction(const char *pActionDir, } catch (CABRTException& e) { - warn_client(ssprintf("RunAction(): %s", e.what().c_str())); - update_client(ssprintf("Execution of '%s' was not successful: %s", pPluginName, e.what().c_str())); + warn_client(ssprintf("RunAction(): %s", e.what())); + update_client(ssprintf("Execution of '%s' was not successful: %s", pPluginName, e.what())); } } @@ -295,8 +295,8 @@ void RunActionsAndReporters(const char *pDebugDumpDir) } catch (CABRTException& e) { - warn_client("RunActionsAndReporters(): " + e.what()); - update_client("Activation of plugin '" + it_ar->first + "' was not successful: " + e.what()); + warn_client(e.what()); + update_client(ssprintf("Activation of plugin '%s' was not successful: %s", it_ar->first.c_str(), e.what())); } } } @@ -435,8 +435,7 @@ report_status_t Report(const map_crash_report_t& pCrashReport, { ret[pluginName].push_back("0"); ret[pluginName].push_back(e.what()); - warn_client("Report(): " + e.what()); - update_client("Reporting via '" + pluginName + "' was not successful: " + e.what()); + update_client(ssprintf("Reporting via %s' was not successful: %s", pluginName.c_str(), e.what())); } } } @@ -565,7 +564,7 @@ static mw_result_t SavePackageDescriptionToDebugDump(const char *pExecutable, } catch (CABRTException& e) { - warn_client("SavePackageDescriptionToDebugDump(): " + e.what()); + warn_client(e.what()); if (e.type() == EXCEP_DD_SAVE) { return MW_FILE_ERROR; @@ -601,8 +600,7 @@ static void RunAnalyzerActions(const char *pAnalyzer, const char *pDebugDumpDir) } catch (CABRTException& e) { - warn_client("RunAnalyzerActions(): " + e.what()); - update_client("Action performed by '" + pluginName + "' was not successful: " + e.what()); + update_client(ssprintf("Action performed by '%s' was not successful: %s", pluginName.c_str(), e.what())); } } } @@ -684,7 +682,7 @@ mw_result_t SaveDebugDump(const char *pDebugDumpDir, } catch (CABRTException& e) { - warn_client("SaveDebugDump(): " + e.what()); + warn_client(e.what()); if (e.type() == EXCEP_DD_SAVE) { return MW_FILE_ERROR; @@ -708,8 +706,8 @@ mw_result_t SaveDebugDump(const char *pDebugDumpDir, } mw_result_t GetCrashInfo(const char *pUUID, - const char *pUID, - map_crash_info_t& pCrashInfo) + const char *pUID, + map_crash_info_t& pCrashInfo) { pCrashInfo.clear(); CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase); @@ -734,7 +732,7 @@ mw_result_t GetCrashInfo(const char *pUUID, } catch (CABRTException& e) { - warn_client("GetCrashInfo(): " + e.what()); + warn_client(e.what()); if (e.type() == EXCEP_DD_LOAD) { return MW_FILE_ERROR; diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 2363308a..aa0b5315 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -179,8 +179,7 @@ void CPluginManager::LoadPlugin(const std::string& pName) catch (CABRTException& e) { delete abrtPlugin; - warn_client("CPluginManager::LoadPlugin(): " + e.what()); - warn_client("Failed to load plugin " + pName); + warn_client(ssprintf("Failed to load plugin %s: %s", pName.c_str(), e.what())); } } } @@ -218,7 +217,7 @@ void CPluginManager::RegisterPlugin(const std::string& pName) log("Can't initialize plugin %s(%s): %s", pName.c_str(), plugin_type_str[abrt_plugin->second->GetType()], - e.what().c_str() + e.what() ); UnLoadPlugin(pName); return; |