| | |
| | | package com.xxl.job.admin.controller.resolver; |
| | | |
| | | import com.xxl.job.admin.core.exception.XxlJobException; |
| | | import com.xxl.job.admin.core.util.JacksonUtil; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.admin.core.util.JacksonUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | HttpServletResponse response, Object handler, Exception ex) { |
| | | |
| | | if (!(ex instanceof XxlJobException)) { |
| | | logger.error("WebExceptionResolver:{}" , ex); |
| | | logger.error("WebExceptionResolver:{}", ex); |
| | | } |
| | | |
| | | // if json |
| | |
| | | } |
| | | |
| | | // error result |
| | | ReturnT<String> errorResult = new ReturnT<String>(ReturnT.FAIL_CODE, ex.toString().replaceAll("\n" , "<br/>")); |
| | | ReturnT<String> errorResult = new ReturnT<String>(ReturnT.FAIL_CODE, ex.toString().replaceAll("\n", "<br/>")); |
| | | |
| | | // response |
| | | ModelAndView mv = new ModelAndView(); |
| | |
| | | return mv; |
| | | } else { |
| | | |
| | | mv.addObject("exceptionMsg" , errorResult.getMsg()); |
| | | mv.addObject("exceptionMsg", errorResult.getMsg()); |
| | | mv.setViewName("/common/common.exception"); |
| | | return mv; |
| | | } |