= null) { str = string.Format(strDateInfo + "异常类型:{0}\r\n异常消息:{1}\r\n异常信息:{2}\r\n", error.GetType().Name, error.Message, error.StackTrace); } else { str = string.Format("应用程序线程错误:{0}", e); } WriteLog...
public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) { ex.printStackTrace(); CustomException customException = null; //如果抛出的是系统自定义的异常则直接转换 if(ex instanceof CustomException) { customException = (CustomException) ex...
private static String getExceptionInfo(Exception ex) { ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintStream printStream = new PrintStream(out); ex.printStackTrace(printStream); String rs = new String(out.toByteArray()); try { printStream.close(); out.close(); } catch (Exceptio...
catch(Exception ex) { varstrDateInfo ="出现应用程序未处理的异常:"+ DateTime.Now +"\r\n"; varstr =string.Format(strDateInfo +"异常类型:{0}\r\n异常消息:{1}\r\n异常信息:{2}\r\n", ex.GetType().Name, ex.Message, ex.StackTrace); WriteLog(str);//日志写入 MessageBox.Show("发生1...