1
|
package eu.dnetlib.functionality.modular.ui;
|
2
|
|
3
|
import org.springframework.http.HttpStatus;
|
4
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
5
|
import org.springframework.web.bind.annotation.ResponseBody;
|
6
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
7
|
|
8
|
import eu.dnetlib.functionality.modular.ui.error.ErrorMessage;
|
9
|
|
10
|
public abstract class AbstractAjaxController {
|
11
|
|
12
|
@ExceptionHandler(Exception.class)
|
13
|
@ResponseStatus(value=HttpStatus.INTERNAL_SERVER_ERROR)
|
14
|
public @ResponseBody ErrorMessage handleException(final Exception e) {
|
15
|
return ErrorMessage.newInstance(e);
|
16
|
}
|
17
|
|
18
|
}
|