package eu.kielczewski.akanke.web.controller.advice;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import java.util.NoSuchElementException;
@ControllerAdvice
public class ExceptionHandlerControllerAdvice {
@ExceptionHandler(NoSuchElementException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
public String handleDocumentNotFoundException(NoSuchElementException e) {
return e.getMessage();
}
}