Class ExceptionManager


  • public class ExceptionManager
    extends Object
    The Class ExceptionManager.
    Author:
    Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) Dec 14, 2018
    • Constructor Detail

      • ExceptionManager

        public ExceptionManager()
    • Method Detail

      • internalErrorException

        public static InternalServerException internalErrorException​(javax.servlet.http.HttpServletRequest httpRequest,
                                                                     String errorMessage,
                                                                     Class thrownBy,
                                                                     String helpURI)
        Internal error exception.
        Parameters:
        httpRequest - the http request
        errorMessage - the error message
        thrownBy - the thrown by
        helpURI - the help uri
        Returns:
        the internal server exception
      • badRequestException

        public static BadRequestException badRequestException​(javax.servlet.http.HttpServletRequest httpRequest,
                                                              String errorMessage,
                                                              Class thrownBy,
                                                              String helpURI)
        Bad request exception.
        Parameters:
        httpRequest - the http request
        errorMessage - the error message
        thrownBy - the thrown by
        helpURI - the help uri
        Returns:
        the bad request exception
      • wrongParameterException

        public static WrongParameterException wrongParameterException​(javax.servlet.http.HttpServletRequest httpRequest,
                                                                      String errorMessage,
                                                                      Class thrownBy,
                                                                      String helpURI)
        Wrong parameter exception.
        Parameters:
        httpRequest - the http request
        errorMessage - the error message
        thrownBy - the thrown by
        helpURI - the help uri
        Returns:
        the wrong parameter exception
      • notFoundException

        public static NotFoundException notFoundException​(javax.servlet.http.HttpServletRequest httpRequest,
                                                          String errorMessage,
                                                          Class thrownBy,
                                                          String helpURI)
        Not found exception.
        Parameters:
        httpRequest - the http request
        errorMessage - the error message
        thrownBy - the thrown by
        helpURI - the help uri
        Returns:
        the not found exception
      • unauthorizedException

        public static NotAuthorizedRequestException unauthorizedException​(javax.servlet.http.HttpServletRequest httpRequest,
                                                                          String errorMessage,
                                                                          Class thrownBy,
                                                                          String helpURI)
        Unauthorized exception.
        Parameters:
        httpRequest - the http request
        errorMessage - the error message
        thrownBy - the thrown by
        helpURI - the help uri
        Returns:
        the not authorized request exception
      • forbiddenException

        public static ForbiddenRequestException forbiddenException​(javax.servlet.http.HttpServletRequest httpRequest,
                                                                   String errorMessage,
                                                                   Class thrownBy,
                                                                   String helpURI)
        Forbidden exception.
        Parameters:
        httpRequest - the http request
        errorMessage - the error message
        thrownBy - the thrown by
        helpURI - the help uri
        Returns:
        the forbidden request exception
      • checkURI

        public static URI checkURI​(String helpURI)
        Check uri.
        Parameters:
        helpURI - the help uri
        Returns:
        the uri