package cn.gistack.by.nettyUpload.utils;
|
|
import java.io.PrintWriter;
|
import java.io.StringWriter;
|
|
public class ExceptionUtils {
|
/**
|
* 获取异常堆栈字符串。
|
*
|
* @param t {@link Throwable}
|
* @return
|
*/
|
public static String getStackString(Throwable t) {
|
StringWriter sw = new StringWriter();
|
t.printStackTrace(new PrintWriter(sw, true));
|
return sw.getBuffer().toString();
|
}
|
}
|