return SERVER_ERROR;
}
catch (...) {
- if (g_catchAll) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_check_user threw an uncaught exception!");
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_check_user threw an unknown exception!");
+ if (g_catchAll)
return SERVER_ERROR;
- }
throw;
}
}
return SERVER_ERROR;
}
catch (...) {
- if (g_catchAll) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_handler threw an uncaught exception!");
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_handler threw an unknown exception!");
+ if (g_catchAll)
return SERVER_ERROR;
- }
throw;
}
}
return SERVER_ERROR;
}
catch (...) {
- if (g_catchAll) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker threw an uncaught exception!");
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker threw an unknown exception!");
+ if (g_catchAll)
return SERVER_ERROR;
- }
throw;
}
}
return WriteClientError(pfc,"Shibboleth Filter caught an exception, check Event Log for details.");
}
catch(...) {
+ LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, "Shibboleth Filter threw an unknown exception.");
if (g_catchAll)
- return WriteClientError(pfc,"Shibboleth Filter caught an unknown exception.");
+ return WriteClientError(pfc,"Shibboleth Filter threw an unknown exception.");
throw;
}
return WriteClientError(lpECB,"Shibboleth Extension caught an exception, check Event Log for details.");
}
catch(...) {
+ LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, "Shibboleth Extension threw an unknown exception.");
if (g_catchAll)
- return WriteClientError(lpECB,"Shibboleth Extension caught an unknown exception.");
+ return WriteClientError(lpECB,"Shibboleth Extension threw an unknown exception.");
throw;
}
return WriteClientError(sn, rq, FUNC, "Shibboleth module threw an exception, see web server log for error.");
}
catch (...) {
+ log_error(LOG_FAILURE,FUNC,sn,rq,const_cast<char*>("Shibboleth module threw an unknown exception."));
if (g_catchAll)
- return WriteClientError(sn, rq, FUNC, "Shibboleth module threw an uncaught exception.");
+ return WriteClientError(sn, rq, FUNC, "Shibboleth module threw an unknown exception.");
throw;
}
}
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>\r
</sequence>\r
<attribute name="logger" type="anyURI"/>\r
+ <attribute name="catchAll" type="boolean"/>\r
<anyAttribute namespace="##other" processContents="lax"/>\r
</complexType>\r
</element>\r
#include "internal.h"
#include "exceptions.h"
+#include "ServiceProvider.h"
#include "remoting/impl/SocketListener.h"
#include <errno.h>
m_lock->unlock();
}
-SocketListener::SocketListener(const DOMElement* e) : log(&Category::getInstance(SHIBSP_LOGCAT".Listener")),
+SocketListener::SocketListener(const DOMElement* e) : m_catchAll(false), log(&Category::getInstance(SHIBSP_LOGCAT".Listener")),
m_socketpool(NULL), m_shutdown(NULL), m_child_lock(NULL), m_child_wait(NULL), m_socket((ShibSocket)0)
{
// Are we a client?
#endif
log->info("listener service starting");
+ ServiceProvider* sp = SPConfig::getConfig().getServiceProvider();
+ sp->lock();
+ const PropertySet* props = sp->getPropertySet("OutOfProcess");
+ if (props) {
+ pair<bool,bool> flag = props->getBool("catchAll");
+ m_catchAll = flag.first && flag.second;
+ }
+ sp->unlock();
+
// Save flag to monitor for shutdown request.
m_shutdown=shutdown;
unsigned long count = 0;
}
catch (...) {
log->crit("error starting new server thread to service incoming request");
+ if (!m_catchAll)
+ *m_shutdown = true;
}
}
}
DDFJanitor jout(out);
sink << out;
}
-#ifndef _DEBUG
catch (...) {
if (incomingError)
log.error("unexpected error processing incoming message");
+ if (!m_listener->m_catchAll)
+ throw;
ListenerException ex("An unexpected error occurred while processing an incoming message.");
DDF out=DDF("exception").string(ex.toString().c_str());
DDFJanitor jout(out);
sink << out;
}
-#endif
// Return whatever's available.
string response(sink.str());
virtual int send(ShibSocket& s, const char* buf, int len) const=0;
virtual int recv(ShibSocket& s, char* buf, int buflen) const=0;
+ bool m_catchAll;
protected:
bool log_error() const; // for OS-level errors
xmltooling::logging::Category* log;