Data model
Error handling
In the OpenMRS core there are 2 pages where uncaught exceptions are handled, which are uncaughtException.jsp and errorHandler.jsp.
Error handling at the application level
Exceptions thrown by code going threw Servlets and Controllers are handled by uncaughtException.jsp because of the web.xml entry.
Code Block |
---|
|
...
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/uncaughtException</location>
</error-page>
<servlet-mapping>
<servlet-name>openmrs</servlet-name>
<url-pattern>/uncaughtException</url-pattern>
</servlet-mapping>
... |
Error handling at the page level
Exceptions thrown from the .tag files and jsps including embedded scriptlets are handled by errorHandler.jsp which is defined as the default error page via a jsp directive.
Code Block |
---|
language | java |
---|
title | errorHandler.jsp |
---|
|
<%@ page isErrorPage="true" import="java.io.*" %>
... |
Code Block |
---|
language | java |
---|
title | header.jsp |
---|
|
<%@ page errorPage="/errorhandler.jsp" %>
... |
Ignored exceptions