[cpp-sp] 02/02: CPPSP-42 Logging from Status handler could be more informative.

Codeberg noreply at shibboleth.net
Thu Jan 22 20:12:54 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository cpp-sp.

View the commit online:
https://codeberg.org/Shibboleth/cpp-sp/commit/82076d47a8e0df299f9419808bc24a43a84ef23e

commit 82076d47a8e0df299f9419808bc24a43a84ef23e
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Jan 22 20:11:19 2026 +0000

    CPPSP-42 Logging from Status handler could be more informative.
    
    https://shibboleth.atlassian.net/browse/CPPSP-42
    
    Stage 1:  If relevant collect the event from the AgentException
    and log it and insert it into the XML output.
---
 shibsp/handler/impl/StatusHandler.cpp | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/shibsp/handler/impl/StatusHandler.cpp b/shibsp/handler/impl/StatusHandler.cpp
index f14ec218..48efb038 100644
--- a/shibsp/handler/impl/StatusHandler.cpp
+++ b/shibsp/handler/impl/StatusHandler.cpp
@@ -274,13 +274,21 @@ pair<bool,long> StatusHandler::run(SPRequest& request, bool isHandler) const
         request.setContentType("text/xml");
         return make_pair(true, request.sendResponse(s));
     }
-    catch (const exception& ex) {
-        request.error(string("error while processing request: ") + ex.what());
+
+    catch (exception& ex) {
+
+        string fullDetails(string(ex.what()));
+        AgentException* agent_ex = dynamic_cast<AgentException*>(&ex);
+        if (agent_ex && agent_ex->getProperty(AgentException::EVENT_PROP_NAME)) {
+            fullDetails +=  string(" (") + agent_ex->getProperty(AgentException::EVENT_PROP_NAME) + ")";
+        }
+
+        request.error(string("error while processing request: ") + fullDetails);
         request.setContentType("text/xml");
         stringstream msg;
         msg << "<StatusHandler time='" << timestamp << "'>"
             << "<Version Shibboleth='" << PACKAGE_VERSION << "'/>";
-        systemInfo(msg) << "<Status><Exception typename='" << typeid(ex).name() << "'>" << ex.what() << "</Exception></Status>"
+        systemInfo(msg) << "<Status><Exception typename='" << typeid(ex).name() << "'>" << fullDetails << "</Exception></Status>"
             << "</StatusHandler>";
         return make_pair(true, request.sendResponse(msg, HTTPResponse::SHIBSP_HTTP_STATUS_ERROR));
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list