use of lee.study.down.model.ResultInfo in project proxyee-down by monkeyWie.
the class RestExceptionHandler method resolveException.
@Override
public ModelAndView resolveException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) {
LOGGER.error("rest error:", e);
ModelAndView modelAndView = new ModelAndView();
try {
ResultInfo resultInfo = new ResultInfo().setStatus(ResultStatus.ERROR.getCode()).setMsg(ResultInfo.MSG_ERROR);
Map<String, Object> attr = JSON.parseObject(JSON.toJSONString(resultInfo), Map.class);
MappingJackson2JsonView view = new MappingJackson2JsonView();
view.setAttributesMap(attr);
modelAndView.setView(view);
} catch (Exception e1) {
e1.printStackTrace();
}
return modelAndView;
}
Aggregations