Java の Exception の stack trace を文字列にする
String getStackTraceAsString(Exception e) {
var writer = new StringWriter();
e.printStackTrace(new PrintWriter(writer));
writer.flush();
return writer.toString();
}
String getStackTraceAsString(Exception e) {
var writer = new StringWriter();
e.printStackTrace(new PrintWriter(writer));
writer.flush();
return writer.toString();
}