1:異常信息全部轉(zhuǎn)換字符串 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(); } |
|
來(lái)自: Sunny_Gql > 《Java Tools》