[cpp-sp] branch master updated: Add Xerces exception handler to remoting method.

Scott Cantor cantor.2 at osu.edu
Thu Dec 13 11:11:44 EST 2018


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

scantor pushed a commit to branch master
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=86badd67af4bf75196a21815df97a8deb6fde978

The following commit(s) were added to refs/heads/master by this push:
       new  86badd6   Add Xerces exception handler to remoting method.
86badd6 is described below

commit 86badd67af4bf75196a21815df97a8deb6fde978
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Dec 13 11:11:38 2018 -0500

    Add Xerces exception handler to remoting method.
---
 shibsp/remoting/impl/SocketListener.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/shibsp/remoting/impl/SocketListener.cpp b/shibsp/remoting/impl/SocketListener.cpp
index af5e29f..c9cbc14 100644
--- a/shibsp/remoting/impl/SocketListener.cpp
+++ b/shibsp/remoting/impl/SocketListener.cpp
@@ -376,7 +376,7 @@ DDF SocketListener::send(const DDF& in)
             except=XMLToolingException::fromString(out.string());
             log->error("remoted message returned an error: %s", except->what());
         }
-        catch (XMLToolingException& e) {
+        catch (const XMLToolingException& e) {
             log->error("caught XMLToolingException while building the XMLToolingException: %s", e.what());
             log->error("XML was: %s", out.string());
             throw ListenerException("Remote call failed with an unparsable exception.");
@@ -560,6 +560,15 @@ int ServerThread::job()
         // Dispatch the message.
         m_listener->receive(in, sink);
     }
+    catch (const xercesc::XMLException& e) {
+        auto_ptr_char temp(e.getMessage());
+        if (incomingError)
+            log.error("error processing incoming message: %s", temp.get() ? temp.get() : "no message");
+        XMLParserException ex(string("Xerces error: ") + (temp.get() ? temp.get() : "no message"));
+        DDF out=DDF("exception").string(ex.toString().c_str());
+        DDFJanitor jout(out);
+        sink << out;
+    }
     catch (const XMLToolingException& e) {
         if (incomingError)
             log.error("error processing incoming message: %s", e.what());

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


More information about the commits mailing list