/** * 将异常信息转化成字符串 * @param t * @return * @throws IOException */ private static String exception(Throwable t) throws IOException{ if(t == null) return null; ByteArrayOutputStream baos = new ByteArrayOutputStream(); try{ t.printStackTrace(new PrintStream(baos)); }finally{ baos.close(); } return baos.toString(); }
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/10911.html