parent
85c70a450c
commit
517a9e0630
|
@ -371,12 +371,12 @@ public class ExceptionUtils {
|
||||||
* {@code printStackTrace(PrintWriter)} method, or an empty String if {@code null} input
|
* {@code printStackTrace(PrintWriter)} method, or an empty String if {@code null} input
|
||||||
*/
|
*/
|
||||||
public static String getStackTrace(final Throwable throwable) {
|
public static String getStackTrace(final Throwable throwable) {
|
||||||
final StringWriter sw = new StringWriter();
|
if (throwable == null) {
|
||||||
final PrintWriter pw = new PrintWriter(sw, true);
|
return StringUtils.EMPTY;
|
||||||
if (throwable != null) {
|
|
||||||
throwable.printStackTrace(pw);
|
|
||||||
}
|
}
|
||||||
return sw.getBuffer().toString();
|
final StringWriter sw = new StringWriter();
|
||||||
|
throwable.printStackTrace(new PrintWriter(sw, true));
|
||||||
|
return sw.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue