summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2010-09-01 09:29:24 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2010-09-02 16:42:33 +0200
commit5cb354fd18e2a06ffc55910ceb0c1d1f284bf1f7 (patch)
tree046f2c1cd7266c2a52945b788edcb257db3c63de /lib
parent2aed4861f40056faf77506b9579824ffcb4d6643 (diff)
downloadabrt-5cb354fd18e2a06ffc55910ceb0c1d1f284bf1f7.tar.gz
abrt-5cb354fd18e2a06ffc55910ceb0c1d1f284bf1f7.tar.xz
abrt-5cb354fd18e2a06ffc55910ceb0c1d1f284bf1f7.zip
KerneloopsReporer: throw when missing bt
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/plugins/KerneloopsReporter.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/plugins/KerneloopsReporter.cpp b/lib/plugins/KerneloopsReporter.cpp
index cee1bad7..edb333b0 100644
--- a/lib/plugins/KerneloopsReporter.cpp
+++ b/lib/plugins/KerneloopsReporter.cpp
@@ -90,24 +90,24 @@ std::string CKerneloopsReporter::Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs)
{
- CURLcode ret;
+ CURLcode ret = CURLE_OK;
update_client(_("Creating and submitting a report..."));
map_crash_data_t::const_iterator it = pCrashData.find(FILENAME_BACKTRACE);
- if (it != pCrashData.end())
+ if (it == pCrashData.end())
+ throw CABRTException(EXCEP_PLUGIN, "Error sending kernel oops due to missing backtrace");
+
+ ret = http_post_to_kerneloops_site(
+ m_sSubmitURL.c_str(),
+ it->second[CD_CONTENT].c_str()
+ );
+ if (ret != CURLE_OK)
{
- ret = http_post_to_kerneloops_site(
- m_sSubmitURL.c_str(),
- it->second[CD_CONTENT].c_str()
- );
- if (ret != CURLE_OK)
- {
- char* err_str = xasprintf("Kernel oops has not been sent due to %s", curl_easy_strerror(ret));
- CABRTException e(EXCEP_PLUGIN, err_str);
- free(err_str);
- throw e;
- }
+ char* err_str = xasprintf("Kernel oops has not been sent due to %s", curl_easy_strerror(ret));
+ CABRTException e(EXCEP_PLUGIN, err_str);
+ free(err_str);
+ throw e;
}
/* Server replies with: