use of org.entando.entando.web.common.model.RestError in project entando-core by entando.
the class RestExceptionHandler method processRuntimeExceptionException.
@ExceptionHandler(value = RuntimeException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseBody
public RestResponse processRuntimeExceptionException(RuntimeException ex) {
logger.debug("Handling {} error", ex.getClass().getSimpleName());
RestResponse response = new RestResponse();
RestError error = new RestError(RestErrorCodes.INTERNAL_ERROR, this.resolveLocalizedErrorMessage("GENERIC_ERROR", new Object[] { ex.getMessage() }));
List<RestError> errors = new ArrayList<>();
errors.add(error);
response.setErrors(errors);
ex.printStackTrace();
return response;
}
Aggregations