Skip to content

Commit

Permalink
TRUNK-4300 - OpenmrsCookieThemeResolver should never throw an excepti…
Browse files Browse the repository at this point in the history
…on, because that would break the uncaughtException page

(cherry picked from commit cf9f6e1)
  • Loading branch information
djazayeri committed Mar 5, 2014
1 parent db284a1 commit f94a2c2
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -21,6 +21,9 @@
/**
* Customization of the spring theme resolver so that an admin can set a global property for the
* default locale for the system
*
* This class will not throw an exception even if there is a problem retrieving that global property, since that
* prevent even an error page from being displayed properly
*/
public class OpenmrsCookieThemeResolver extends CookieThemeResolver {

Expand All @@ -45,6 +48,10 @@ public String getDefaultThemeName() {
// check the admin-set global property for the theme
themeName = Context.getAdministrationService().getGlobalProperty(GP_THEME_NAME);
}
catch (Exception ex) {
// We must not throw an exception here, since this code is called from every page including the
// for uncaught exceptions. Therefore we pass, and fall back to default behavior.
}
finally {
// only close the session if we opened it
if (openedSession)
Expand Down

0 comments on commit f94a2c2

Please sign in to comment.