threadid << "[" << getpid() << "] shib_check_user" << '\0';
saml::NDC ndc(threadid.str().c_str());
-#ifndef _DEBUG
try {
-#endif
ShibTargetApache sta(r);
// Check user authentication and export information, then set the handler bypass
// export happened successfully.. this user is ok.
return OK;
-
+ }
+ catch (SAMLException& e) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_check_user threw an exception: %s", e.what());
+ return SERVER_ERROR;
+ }
#ifndef _DEBUG
- } catch (...) {
+ catch (...) {
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_check_user threw an uncaught exception!");
return SERVER_ERROR;
}
ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r),"shib_handler(%d): ENTER: %s", (int)getpid(), r->handler);
-#ifndef _DEBUG
try {
-#endif
ShibTargetApache sta(r);
pair<bool,void*> res = sta.doHandler();
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "doHandler() did not do anything.");
return SERVER_ERROR;
-
+ }
+ catch (SAMLException& e) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_handler threw an exception: %s", e.what());
+ return SERVER_ERROR;
+ }
#ifndef _DEBUG
- } catch (...) {
+ catch (...) {
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_handler threw an uncaught exception!");
return SERVER_ERROR;
}
threadid << "[" << getpid() << "] shib_auth_checker" << '\0';
saml::NDC ndc(threadid.str().c_str());
-#ifndef _DEBUG
try {
-#endif
ShibTargetApache sta(r);
pair<bool,void*> res = sta.doCheckAuthZ();
// We're all okay.
return OK;
-
+ }
+ catch (SAMLException& e) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker threw an exception: %s", e.what());
+ return SERVER_ERROR;
+ }
#ifndef _DEBUG
- } catch (...) {
+ catch (...) {
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker threw an uncaught exception!");
return SERVER_ERROR;
}
if (e==ERROR_NO_DATA)
return WriteClientError(pfc,"A required variable or header was empty.");
else
- return WriteClientError(pfc,"Server detected unexpected IIS error.");
+ return WriteClientError(pfc,"Shibboleth Filter detected unexpected IIS error.");
+ }
+ catch (SAMLException& e) {
+ LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, e.what());
+ return WriteClientError(pfc,"Shibboleth Filter caught an exception, check Event Log for details.");
}
#ifndef _DEBUG
catch(...) {
- return WriteClientError(pfc,"Server caught an unknown exception.");
+ return WriteClientError(pfc,"Shibboleth Filter caught an unknown exception.");
}
#endif
- return WriteClientError(pfc,"Server reached unreachable code, save my walrus!");
+ return WriteClientError(pfc,"Shibboleth Filter reached unreachable code, save my walrus!");
}
else
return WriteClientError(lpECB,"Server detected unexpected IIS error.");
}
+ catch (SAMLException& e) {
+ LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, e.what());
+ return WriteClientError(lpECB,"Shibboleth Extension caught an exception, check Event Log for details.");
+ }
#ifndef _DEBUG
catch(...) {
- return WriteClientError(lpECB,"Server caught an unknown exception.");
+ return WriteClientError(lpECB,"Shibboleth Extension caught an unknown exception.");
}
#endif