loga
This commit is contained in:
parent
28788aba95
commit
3099a06e47
|
@ -1,6 +1,8 @@
|
|||
package eu.dnetlib.common.controller;
|
||||
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
@ -8,9 +10,12 @@ import org.springframework.web.bind.annotation.ResponseStatus;
|
|||
|
||||
public abstract class AbstractDnetController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AbstractDnetController.class);
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
public @ResponseBody ErrorMessage handleException(final Exception e) {
|
||||
log.error("Error processing http method", e);
|
||||
return new ErrorMessage(e);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue