[cpp-sp COMMIT] in /branches/REL_2/shibsp: binding/impl/ArtifactResolver.cpp handler/impl/AbstractHandler.cpp

noreply at shibboleth.net noreply at shibboleth.net
Tue Jan 31 16:52:36 GMT 2012


Author: scantor
Date: Tue Jan 31 16:52:36 2012
New Revision: 3566

URL: http://svn.shibboleth.net/view/cpp-sp?rev=3566&view=rev
Log:
Pass 1.x Status objects into new annotate method.

Modified:
    branches/REL_2/shibsp/binding/impl/ArtifactResolver.cpp
    branches/REL_2/shibsp/handler/impl/AbstractHandler.cpp

Modified: branches/REL_2/shibsp/binding/impl/ArtifactResolver.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/shibsp/binding/impl/ArtifactResolver.cpp?rev=3566&r1=3565&r2=3566&view=diff
==============================================================================
--- branches/REL_2/shibsp/binding/impl/ArtifactResolver.cpp (original)
+++ branches/REL_2/shibsp/binding/impl/ArtifactResolver.cpp Tue Jan 31 16:52:36 2012
@@ -102,8 +102,9 @@
         throw BindingException("Unable to resolve artifact(s) into a SAML response.");
     const xmltooling::QName* code = (response->getStatus() && response->getStatus()->getStatusCode()) ? response->getStatus()->getStatusCode()->getValue() : nullptr;
     if (!code || *code != saml1p::StatusCode::SUCCESS) {
-        delete response;
-        throw BindingException("Identity provider returned a SAML error in response to artifact(s).");
+        auto_ptr<saml1p::Response> wrapper(response);
+        BindingException ex("Identity provider returned a SAML error in response to artifact.");
+        annotateException(&ex, &idpDescriptor, response->getStatus());  // rethrow
     }
 
     // The SOAP client handles policy evaluation against the SOAP and Response layer,

Modified: branches/REL_2/shibsp/handler/impl/AbstractHandler.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/shibsp/handler/impl/AbstractHandler.cpp?rev=3566&r1=3565&r2=3566&view=diff
==============================================================================
--- branches/REL_2/shibsp/handler/impl/AbstractHandler.cpp (original)
+++ branches/REL_2/shibsp/handler/impl/AbstractHandler.cpp Tue Jan 31 16:52:36 2012
@@ -475,18 +475,7 @@
             const xmltooling::QName* code = sc ? sc->getValue() : nullptr;
             if (code && *code != saml1p::StatusCode::SUCCESS) {
                 FatalProfileException ex("SAML response contained an error.");
-                ex.addProperty("statusCode", code->toString().c_str());
-                if (sc->getStatusCode()) {
-                    code = sc->getStatusCode()->getValue();
-                    if (code)
-                        ex.addProperty("statusCode2", code->toString().c_str());
-                }
-                if (status->getStatusMessage()) {
-                    auto_ptr_char msg(status->getStatusMessage()->getMessage());
-                    if (msg.get() && *msg.get())
-                        ex.addProperty("statusMessage", msg.get());
-                }
-                ex.raise();
+                annotateException(&ex, role, status);   // throws it
             }
         }
     }



More information about the commits mailing list