Exception 強(qiáng)轉(zhuǎn) BusinessException 不成功 java.lang.ClassCastException: java.lang.NullPointerException cannot be cast to com.dmsc.error.BusinessException at com.dmsc.conrtoller.UserConrtoller.handlerException(UserConrtoller.java:46) ~[classes/:na]
@ExceptionHandler(Exception.class)??
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public Object handlerException(HttpServletRequest repuest,Exception ex){
BusinessException businessException = (BusinessException) ex;
CommonReyurnType type = new CommonReyurnType();
/* Map<String, Object> map? = new HashMap<>();?
map.put("errcode", businessException.getErrCode());
map.put("errmsg", businessException.getErrMsg());*/
type.setStatus("fail");
type.setData(ex);
return type;
}
2019-09-22
2019-07-15
我也是這個(gè)問題
2019-06-05
同樣問題
2019-04-29
解決問題了么?
同樣這個(gè)問題
2019-04-27
傳參的時(shí)候沒傳ex,你看看ex是不是null