VIVO-363 Write the exception to the log, first thing.

This commit is contained in:
j2blake 2013-10-15 12:59:57 -04:00
parent dfc3163ac1
commit 3b6d65176d

View file

@ -5,7 +5,19 @@
<%@ page import="com.oreilly.servlet.ServletUtils,edu.cornell.mannlib.vitro.webapp.web.*" %>
<%@page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%>
<%@page import="edu.cornell.mannlib.vitro.webapp.beans.ApplicationBean"%>
<%@page import="org.apache.commons.logging.Log"%>
<%@page import="org.apache.commons.logging.LogFactory"%>
<%
// We have seen that this page can throw its own error.
// Before it does so, be sure that we have written the original error to the log.
Object c = request.getAttribute("javax.servlet.jsp.jspException");
if (c instanceof Throwable) {
Throwable cause = (Throwable) c;
Log log = LogFactory.getLog(this.getClass());
log.error("Error: ", cause);
}
VitroRequest vreq = new VitroRequest(request);
ApplicationBean appBean = vreq.getAppBean();
String themeDir = appBean.getThemeDir();