Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the OpenMRS core there are 2 pages where uncaught exceptions are handled, which are uncaughtException.jsp and errorHandler.jsp. When uncaught exception occurred one of those pages is displayed and Error Logging Module is notified by about it via extension points in those pages. To get exception and detail information about it is used an attribute of the request "javax.servlet.error.exception".

Error handling at the application level

...

Code Block
languagejava
titleweb.xml
...
<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>
...

To get those types of exceptions is used extension point in the uncaughtException.jsp. 

Code Block
languagejava
titleuncaughtException.jsp
...
<openmrs:extensionPoint pointId="org.openmrs.uncaughtException" type="html" />
...

Error handling at the page level

...

Code Block
languagejava
titleheader.jsp
<%@ page errorPage="/errorhandler.jsp" %>
...

To get those types of exceptions is used extension point in the errorHandler.jsp. 

Code Block
languagejava
titleerrorHandler.jsp

...
<openmrs:extensionPoint pointId="org.openmrs.errorHandler" type="html" />
...

Ignored exceptions