when post failed, abrt still show message
that everything is fine
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
lib/plugins/KerneloopsReporter.cpp | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/lib/plugins/KerneloopsReporter.cpp b/lib/plugins/KerneloopsReporter.cpp
index cee1bad..76f8ed1 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())
+ return "Kernel oops report was failed, missiging 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:
--
1.7.1