Package services.gui
Class JatosGuiExceptionThrower
- java.lang.Object
-
- services.gui.JatosGuiExceptionThrower
-
@Singleton public class JatosGuiExceptionThrower extends java.lang.ObjectClass with convenience methods to throw aJatosGuiException. It checks whether the call is an Ajax one. It puts the error message into the RequestScopeMessaging.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidthrowAjax(java.lang.Exception e)Throws a JatosGuiException for an Ajax request (doesn't return a view but a simple text) with the exception's message.voidthrowAjax(java.lang.Exception e, int httpStatus)Throws a JatosGuiException for an Ajax request (doesn't return a view but a simple text) with the exception's message.voidthrowAjax(java.lang.String errorMsg, int httpStatus)Throws a JatosGuiException for an Ajax request (doesn't return a view) with the given error msg and HTTP status.voidthrowHome(play.mvc.Http.Request request, java.lang.Exception e)Throws a JatosGuiException.voidthrowRedirect(java.lang.Exception e, play.api.mvc.Call call)Throws a JatosGuiException that either redirects to the given call if it's a non-Ajax request - or returns the exception's message if it's a Ajax request.voidthrowStudy(play.mvc.Http.Request request, java.lang.Exception e, java.lang.Long studyId)Throws a JatosGuiException.voidthrowStudy(play.mvc.Http.Request request, java.lang.String errorMsg, int httpStatus, java.lang.Long studyId)Throws a JatosGuiException with the given error msg and HTTP status.
-
-
-
Method Detail
-
throwAjax
public void throwAjax(java.lang.String errorMsg, int httpStatus) throws JatosGuiExceptionThrows a JatosGuiException for an Ajax request (doesn't return a view) with the given error msg and HTTP status.- Throws:
JatosGuiException
-
throwAjax
public void throwAjax(java.lang.Exception e) throws JatosGuiExceptionThrows a JatosGuiException for an Ajax request (doesn't return a view but a simple text) with the exception's message. The exception's type determines the response's HTTP status code.- Throws:
JatosGuiException
-
throwAjax
public void throwAjax(java.lang.Exception e, int httpStatus) throws JatosGuiExceptionThrows a JatosGuiException for an Ajax request (doesn't return a view but a simple text) with the exception's message. The HTTP's status code is taken from the parameter.- Throws:
JatosGuiException
-
throwRedirect
public void throwRedirect(java.lang.Exception e, play.api.mvc.Call call) throws JatosGuiExceptionThrows a JatosGuiException that either redirects to the given call if it's a non-Ajax request - or returns the exception's message if it's a Ajax request. The exception's type determines the response's HTTP status code.- Throws:
JatosGuiException
-
throwHome
public void throwHome(play.mvc.Http.Request request, java.lang.Exception e) throws JatosGuiExceptionThrows a JatosGuiException. If it's a non-Ajax request, it puts the exception's message into the request scope and returns the home view. If it's a Ajax request, it just returns the exception's message. The HTTP status code is determined by the exception type.- Throws:
JatosGuiException
-
throwStudy
public void throwStudy(play.mvc.Http.Request request, java.lang.String errorMsg, int httpStatus, java.lang.Long studyId) throws JatosGuiExceptionThrows a JatosGuiException with the given error msg and HTTP status. If non Ajax it shows study's study view. Distinguishes between normal and Ajax request.- Throws:
JatosGuiException
-
throwStudy
public void throwStudy(play.mvc.Http.Request request, java.lang.Exception e, java.lang.Long studyId) throws JatosGuiExceptionThrows a JatosGuiException. If it's a non-Ajax request, it puts the exception's message into the request scope and returns the study's study view. If it's a Ajax request, it just returns the exception's message. The HTTP status code is determined by the exception type.- Throws:
JatosGuiException
-
-