Throwable(是所有Error和Exception的超类) 的一些API:
1.getCause()
2.getStackTrace() 得到 StackTraceElement
StackTraceElement
|-> getFileName 得到产生异常的文件名
|-> getLineNumber 得到异常发生的代码行
|-> getMethodName 得到发生异常的方法
可以使用这些API来改变异常输出的格式。
Throwable(是所有Error和Exception的超类) 的一些API:
1.getCause()
2.getStackTrace() 得到 StackTraceElement
StackTraceElement
|-> getFileName 得到产生异常的文件名
|-> getLineNumber 得到异常发生的代码行
|-> getMethodName 得到发生异常的方法
可以使用这些API来改变异常输出的格式。