|
|
@ -25,12 +25,22 @@ public class ExceptionUtils { |
|
|
|
* @return 返回异常信息 |
|
|
|
*/ |
|
|
|
public static String getErrorStackTrace(Exception ex){ |
|
|
|
return getErrorStackTraceOfThrowable(ex); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description Throwable级别的错误信息 |
|
|
|
* @return |
|
|
|
* @author wxz |
|
|
|
* @date 2021.07.07 14:37 |
|
|
|
*/ |
|
|
|
public static String getErrorStackTraceOfThrowable(Throwable t) { |
|
|
|
StringWriter sw = null; |
|
|
|
PrintWriter pw = null; |
|
|
|
try { |
|
|
|
sw = new StringWriter(); |
|
|
|
pw = new PrintWriter(sw, true); |
|
|
|
ex.printStackTrace(pw); |
|
|
|
t.printStackTrace(pw); |
|
|
|
}finally { |
|
|
|
try { |
|
|
|
if(pw != null) { |
|
|
|