Commit 07b78af8 authored by Matija Obreza's avatar Matija Obreza

NotFoundElement exception returns HTTP status 404

parent fb25aca7
...@@ -23,6 +23,7 @@ import java.util.Map; ...@@ -23,6 +23,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.genesys2.server.exception.MaxPageLimitException; import org.genesys2.server.exception.MaxPageLimitException;
import org.genesys2.server.exception.NotFoundElement;
import org.genesys2.spring.ResourceNotFoundException; import org.genesys2.spring.ResourceNotFoundException;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
...@@ -55,7 +56,7 @@ public class UserControllerAdvice extends BaseController { ...@@ -55,7 +56,7 @@ public class UserControllerAdvice extends BaseController {
} }
@ResponseStatus(HttpStatus.NOT_FOUND) @ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(value = { ResourceNotFoundException.class, NoHandlerFoundException.class }) @ExceptionHandler(value = { ResourceNotFoundException.class, NoHandlerFoundException.class, NotFoundElement.class })
public ModelAndView handleResourceNotFoundException(final Exception e) { public ModelAndView handleResourceNotFoundException(final Exception e) {
final ModelAndView mav = new ModelAndView("/errors/error"); final ModelAndView mav = new ModelAndView("/errors/error");
mav.addObject("exception", e); mav.addObject("exception", e);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment