From: cantor Date: Tue, 8 May 2007 21:27:38 +0000 (+0000) Subject: Isolate nested failures. X-Git-Tag: 1.4.1~521 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=7ced1672922d0fb22769cd341f987aaae8c8242c;p=shibboleth%2Fxmltooling.git Isolate nested failures. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@302 de75baf8-a10c-0410-a50a-987c0e22f00f --- 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); } }