diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-05-07 11:36:39 +0200 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-05-07 11:36:39 +0200 |
| commit | fbbf81b50e14aef8abd036c29d90445bec4667c9 (patch) | |
| tree | 2f48c537c0e30a7677a937f16133b9e36c01258b /src/Daemon | |
| parent | 7d0eaab97308c65d0da2db0a0d2f5710ce36e2fe (diff) | |
| download | abrt-fbbf81b50e14aef8abd036c29d90445bec4667c9.tar.gz abrt-fbbf81b50e14aef8abd036c29d90445bec4667c9.tar.xz abrt-fbbf81b50e14aef8abd036c29d90445bec4667c9.zip | |
New exception handling
Diffstat (limited to 'src/Daemon')
| -rw-r--r-- | src/Daemon/CrashWatcher.cpp | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 2a2f05b..2a3d0f1 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -87,9 +87,13 @@ gboolean CCrashWatcher::handle_event_cb(GIOChannel *gio, GIOCondition condition, cc->m_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT]); } } - catch(std::string err) + catch (CABRTException& e) { - std::cerr << err << std::endl; + std::cerr << e.what() << std::endl; + if (e.type() == EXCEP_ERROR) + { + return -1; + } } } else @@ -295,9 +299,13 @@ void CCrashWatcher::FindNewDumps(const std::string& pPath) m_pMW->Report(*itt); } } - catch(std::string err) + catch (CABRTException& e) { - std::cerr << err << std::endl; + std::cerr << e.what() << std::endl; + if (e.type() == EXCEP_ERROR) + { + exit(-1); + } } } } @@ -391,9 +399,14 @@ vector_crash_infos_t CCrashWatcher::GetCrashInfos(const std::string &pUID) { retval = m_pMW->GetCrashInfos(pUID); } - catch(std::string err) + catch (CABRTException& e) { - std::cerr << err << std::endl; + std::cerr << e.what() << std::endl; + m_pCommLayer->Error(e.what()); + if (e.type() == EXCEP_ERROR) + { + exit(-1); + } } //Notify("Sent crash info"); return retval; @@ -408,9 +421,14 @@ map_crash_report_t CCrashWatcher::CreateReport(const std::string &pUUID,const st m_pMW->CreateCrashReport(pUUID,pUID,crashReport); m_pCommLayer->AnalyzeComplete(crashReport); } - catch(std::string err) + catch (CABRTException& e) { - m_pCommLayer->Error(err); + std::cerr << e.what() << std::endl; + m_pCommLayer->Error(e.what()); + if (e.type() == EXCEP_ERROR) + { + exit(-1); + } } return crashReport; } @@ -428,9 +446,14 @@ bool CCrashWatcher::Report(map_crash_report_t pReport) { m_pMW->Report(pReport); } - catch(std::string err) + catch (CABRTException& e) { - std::cerr << err << std::endl; + std::cerr << e.what() << std::endl; + m_pCommLayer->Error(e.what()); + if (e.type() == EXCEP_ERROR) + { + exit(-1); + } return false; } return true; @@ -442,9 +465,14 @@ bool CCrashWatcher::DeleteDebugDump(const std::string& pUUID, const std::string& { m_pMW->DeleteCrashInfo(pUUID,pUID, true); } - catch(std::string err) + catch (CABRTException& e) { - std::cerr << err << std::endl; + std::cerr << e.what() << std::endl; + m_pCommLayer->Error(e.what()); + if (e.type() == EXCEP_ERROR) + { + return -1; + } return false; } return true; |
