聲明:這段代碼也是從網(wǎng)上摘抄的,當時忘記記錄地址了,此為轉載,勿怪
public static String handleException(Exception e) {
StringBuffer message = new StringBuffer();
StackTraceElement [] exceptionStack=e.getStackTrace();
message.append(e.toString()); // java.lang.NumberFormatException: For input string: "s"
for(StackTraceElement ste : exceptionStack) {
message.append("\n\t at " + ste); // at ***.***.**(**)
}
return message.toString();
}
浙公網(wǎng)安備 33010602011771號