Skip to content
Snippets Groups Projects

Resolve "'Status' button for an edition results in 404"

3 files
+ 49
1
Compare changes
  • Side-by-side
  • Inline

Files

@@ -17,6 +17,7 @@
*/
package nl.tudelft.gitbull.controller;
import javax.persistence.EntityNotFoundException;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
@@ -49,4 +50,16 @@ public class ErrorController extends ResponseEntityExceptionHandler {
};
}
/**
* Handles a NOT FOUND exception occurring within the server. This method simply logs the event and
* redirects the user to a 404 specific error page.
*
* @return The thymeleaf template to be filled out.
*/
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(EntityNotFoundException.class)
public String handle404Exception() {
return "error/404";
}
}
Loading