Skip to content
Snippets Groups Projects

Resolve "ResourceNotFoundException: StudentGroup was not found for person, module: 240, 416"

2 files
+ 13
2
Compare changes
  • Side-by-side
  • Inline

Files

@@ -17,6 +17,7 @@
*/
package nl.tudelft.labracore.controller;
import org.springframework.data.rest.webmvc.ResourceNotFoundException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
@@ -24,11 +25,20 @@ import io.sentry.Sentry;
@ControllerAdvice
public class ErrorController {
/**
* Does nothing to ResourceNotFoundExceptions.
*
* @param e the exception
*/
@ExceptionHandler(ResourceNotFoundException.class)
public void resourceNotFound(ResourceNotFoundException e) {
throw e;
}
/**
* Prints the exception stack trace and returns the error page with the default error message.
*
* @param e the exception
* @return the link to the error page
* @param e the exception
*/
@ExceptionHandler(Exception.class)
public void exception(Exception e) throws Exception {
Loading