diff options
author | Zdenek Prikryl <zprikryl@redhat.com> | 2009-07-24 15:15:27 +0200 |
---|---|---|
committer | Zdenek Prikryl <zprikryl@redhat.com> | 2009-07-24 15:15:27 +0200 |
commit | 052e544305d6b1efde7d28f894ead8771cf62b03 (patch) | |
tree | b03688547d18419a2403a129afcc3a64b41d3c4c /lib/Plugins/Bugzilla.cpp | |
parent | 5d5a2716c60ab645ff93f492563672f448c1a646 (diff) | |
download | abrt-052e544305d6b1efde7d28f894ead8771cf62b03.tar.gz abrt-052e544305d6b1efde7d28f894ead8771cf62b03.tar.xz abrt-052e544305d6b1efde7d28f894ead8771cf62b03.zip |
plugin can report to different bugzillas in different reports
Diffstat (limited to 'lib/Plugins/Bugzilla.cpp')
-rw-r--r-- | lib/Plugins/Bugzilla.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index 6b5233a8..4d834d7b 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -13,14 +13,12 @@ CReporterBugzilla::CReporterBugzilla() : { m_pXmlrpcTransport = new xmlrpc_c::clientXmlTransport_curl(); m_pXmlrpcClient = new xmlrpc_c::client_xml(m_pXmlrpcTransport); - m_pCarriageParm = new xmlrpc_c::carriageParm_curl0(m_sBugzillaURL); } CReporterBugzilla::~CReporterBugzilla() { delete m_pXmlrpcTransport; delete m_pXmlrpcClient; - delete m_pCarriageParm; } PRInt32 CReporterBugzilla::Base64Encode_cb(void *arg, const char *obuf, PRInt32 size) @@ -269,15 +267,26 @@ void CReporterBugzilla::Report(const map_crash_report_t& pCrashReport, const std std::string component = package.substr(0, package.rfind("-", package.rfind("-")-1)); std::string uuid = pCrashReport.find(CD_UUID)->second[CD_CONTENT]; comm_layer_inner_status("Logging into bugzilla..."); - Login(); - comm_layer_inner_status("Checking for duplicates..."); - if (!CheckUUIDInBugzilla(component, uuid)) + m_pCarriageParm = new xmlrpc_c::carriageParm_curl0(m_sBugzillaURL); + try { - comm_layer_inner_status("Creating new bug..."); - NewBug(pCrashReport); + Login(); + comm_layer_inner_status("Checking for duplicates..."); + if (!CheckUUIDInBugzilla(component, uuid)) + { + comm_layer_inner_status("Creating new bug..."); + NewBug(pCrashReport); + } + comm_layer_inner_status("Logging out..."); + Logout(); + } + catch (CABRTException& e) + { + throw CABRTException(EXCEP_PLUGIN, std::string("CReporterBugzilla::Report(): ") + e.what()); + delete m_pCarriageParm; + throw e; } - comm_layer_inner_status("Logging out..."); - Logout(); + delete m_pCarriageParm; } void CReporterBugzilla::LoadSettings(const std::string& pPath) |