Class IridaCustomExceptionHandler
- java.lang.Object
-
- org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
- ca.corefacility.bioinformatics.irida.ria.web.errors.IridaCustomExceptionHandler
-
@ControllerAdvice(basePackages="ca.corefacility.bioinformatics.irida.ria.web") public class IridaCustomExceptionHandler extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
Exception Handler for when a user is navigating around in the web interface.
-
-
Constructor Summary
Constructors Constructor Description IridaCustomExceptionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleAccessDeniedException(org.springframework.security.access.AccessDeniedException ex, javax.servlet.http.HttpServletResponse response)
Handle anAccessDeniedException
void
handleIOException(java.io.IOException e, java.util.Locale locale, javax.servlet.http.HttpServletResponse response)
Catch and handleIOException
s.org.springframework.web.servlet.ModelAndView
handleOAuthProblemException(org.apache.oltu.oauth2.common.exception.OAuthProblemException ex)
Catch anOAuthProblemException
and return an http 500 errorvoid
handleOtherExceptions(java.lang.Exception ex, javax.servlet.http.HttpServletResponse response)
Catch and handle all other exception types and respond with 500 status code.void
handleResourceNotFoundException(EntityNotFoundException ex, javax.servlet.http.HttpServletResponse response)
Handle anEntityNotFoundException
void
handleStorageException(StorageException e, java.util.Locale locale, javax.servlet.http.HttpServletResponse response)
Catch and handle allStorageException
s.-
Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleException, handleExceptionInternal, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMethodArgumentNotValid, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatch
-
-
-
-
Method Detail
-
handleResourceNotFoundException
@ExceptionHandler(EntityNotFoundException.class) public void handleResourceNotFoundException(EntityNotFoundException ex, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
Handle anEntityNotFoundException
- Parameters:
ex
- The EntityNotFoundException caughtresponse
- The HttpServletResponse- Throws:
java.io.IOException
- If an input or output exception occurs
-
handleAccessDeniedException
@ExceptionHandler(org.springframework.security.access.AccessDeniedException.class) public void handleAccessDeniedException(org.springframework.security.access.AccessDeniedException ex, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
Handle anAccessDeniedException
- Parameters:
ex
- The AccessDeniedException caughtresponse
- The HttpServletResponse- Throws:
java.io.IOException
- If an input or output exception occurs
-
handleOAuthProblemException
@ExceptionHandler(org.apache.oltu.oauth2.common.exception.OAuthProblemException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public org.springframework.web.servlet.ModelAndView handleOAuthProblemException(org.apache.oltu.oauth2.common.exception.OAuthProblemException ex)
Catch anOAuthProblemException
and return an http 500 error- Parameters:
ex
- the caughtOAuthProblemException
- Returns:
- A
ModelAndView
containing the name of the oauth error view
-
handleOtherExceptions
@ExceptionHandler(java.lang.Exception.class) public void handleOtherExceptions(java.lang.Exception ex, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
Catch and handle all other exception types and respond with 500 status code.- Parameters:
ex
- the exception that was originally thrown.response
- The HttpServletResponse- Throws:
java.io.IOException
- If an input or output exception occurs
-
handleIOException
@ExceptionHandler(java.io.IOException.class) public void handleIOException(java.io.IOException e, java.util.Locale locale, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
Catch and handleIOException
s. Render an error that's just a general storage exception.- Parameters:
e
- the exception that was originally thrown.locale
- the locale of the request.response
- The HttpServletResponse- Throws:
java.io.IOException
- If an input or output exception occurs
-
handleStorageException
@ExceptionHandler(StorageException.class) public void handleStorageException(StorageException e, java.util.Locale locale, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
Catch and handle allStorageException
s. Try your best to figure out the root cause of the exception.- Parameters:
e
- the exception that was originally thrown.locale
- the locale of the request.response
- The HttpServletResponse- Throws:
java.io.IOException
- If an input or output exception occurs
-
-