| | |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.ProjExceptionDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.servlet.HandlerExceptionResolver; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | |
| | | |
| | | private static final String TRUE = "true"; |
| | | |
| | | @Value("${is_open_exception_report}") |
| | | String isOpenExceptionReport; |
| | | |
| | | |
| | | @Value("${showExcptionUrl}") |
| | | String showExcptionUrl; |
| | | |
| | | |
| | | /** |
| | | * 忽略一些特定的异常 |
| | | */ |
| | |
| | | |
| | | if (ex instanceof GlobleException) { |
| | | // 如果是内部全局异常 |
| | | LogUtil.warn("#程序抛出全局异常#", ex); |
| | | LogUtil.error("#程序抛出全局异常#", ex); |
| | | GlobleException globleException = (GlobleException) ex; |
| | | attr.put("status", globleException.getErrorCode()); |
| | | attr.put("info", globleException.getMessage()); |
| | |
| | | } else { |
| | | |
| | | // 非内部异常 |
| | | LogUtil.error("#程序抛出未捕获异常#", ex); |
| | | LogUtil.error("#程序抛出未捕获异常#"); |
| | | attr.put("status", 999999); |
| | | attr.put("info", InternationaUtil.getMesssge(SystemErrorCode.SYSTEM_UNKNOW_ERROR)); |
| | | // 发送异常信息到管理群 |
| | |
| | | * @email 935090232@qq.com |
| | | * @date 2018年5月9日 |
| | | */ |
| | | public static void sendNoticeToAdmin(Exception ex, String mdc, String requestUrl) { |
| | | public void sendNoticeToAdmin(Exception ex, String mdc, String requestUrl) { |
| | | |
| | | String simpleMsg = ex.getMessage(); |
| | | |
| | | if (!EXCLUDE_EXCEPTION.contains(simpleMsg)) { |
| | | |
| | | |
| | | String isOpenDingdingExceptionNotice = PropertiesUtil.getString("is_open_exception_report"); |
| | | String showExcptionUrl = PropertiesUtil.getString("showExcptionUrl"); |
| | | String isOpenDingdingExceptionNotice =isOpenExceptionReport; |
| | | |
| | | |
| | | if (isOpenDingdingExceptionNotice != null && TRUE.equals(isOpenDingdingExceptionNotice)) { |