From 7ced1672922d0fb22769cd341f987aaae8c8242c Mon Sep 17 00:00:00 2001 From: cantor Date: Tue, 8 May 2007 21:27:38 +0000 Subject: [PATCH] Isolate nested failures. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@302 de75baf8-a10c-0410-a50a-987c0e22f00f --- xmltooling/security/impl/ChainingTrustEngine.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xmltooling/security/impl/ChainingTrustEngine.cpp b/xmltooling/security/impl/ChainingTrustEngine.cpp index 1834aab..f94c234 100644 --- a/xmltooling/security/impl/ChainingTrustEngine.cpp +++ b/xmltooling/security/impl/ChainingTrustEngine.cpp @@ -45,20 +45,20 @@ static const XMLCh type[] = UNICODE_LITERAL_4(t,y,p,e); ChainingTrustEngine::ChainingTrustEngine(const DOMElement* e) : OpenSSLTrustEngine(e) { Category& log=Category::getInstance(XMLTOOLING_LOGCAT".TrustEngine"); - try { - e = e ? XMLHelper::getFirstChildElement(e, _TrustEngine) : NULL; - while (e) { + e = e ? XMLHelper::getFirstChildElement(e, _TrustEngine) : NULL; + while (e) { + try { auto_ptr_char temp(e->getAttributeNS(NULL,type)); if (temp.get() && *temp.get()) { log.info("building TrustEngine of type %s", temp.get()); - m_engines.push_back(XMLToolingConfig::getConfig().TrustEngineManager.newPlugin(temp.get(), e)); + TrustEngine* engine = XMLToolingConfig::getConfig().TrustEngineManager.newPlugin(temp.get(), e); + m_engines.push_back(engine); } - e = XMLHelper::getNextSiblingElement(e, _TrustEngine); } - } - catch (exception&) { - for_each(m_engines.begin(), m_engines.end(), xmltooling::cleanup()); - throw; + catch (exception& ex) { + log.error("error building TrustEngine: %s", ex.what()); + } + e = XMLHelper::getNextSiblingElement(e, _TrustEngine); } } -- 2.1.4