Advertisement
Zebr911

Error page exception handling

May 23rd, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.52 KB | None | 0 0
  1.     ServerException serverException;
  2.  
  3.     if (exception == null || !ServerException.class.isInstance(exception)) {
  4.         serverException = new ServerException(ServerExceptionType.GENERIC);
  5.     } else {
  6.         serverException = (ServerException) exception;
  7.  
  8.         if (!serverException.shouldHaveLocalization())
  9.             serverException = new ServerException(ServerExceptionType.GENERIC);
  10.     }
  11.  
  12.     Locale locale = MessageUtils.getCurrentLocale(request);
  13.     String title = serverException.getTitle(locale);
  14.     String message = serverException.getMessage(locale);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement