提交 721ca127 编写于 作者: K kohsuke

convenience method since this pattern is used many times throughout Hudson

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9887 71c3de6d-444a-0410-be80-ed276b4c234a
上级 a7a4104f
......@@ -26,6 +26,8 @@ import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.PrintStream;
import java.io.StringWriter;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.net.URI;
......@@ -786,6 +788,17 @@ public class Util {
}
}
/**
* Obtains the stack dump as a string.
*
* @since 1.222
*/
public static String toString(Throwable t) {
StringWriter sw = new StringWriter();
t.printStackTrace(new PrintWriter(sw));
return sw.toString();
}
public static final SimpleDateFormat XS_DATETIME_FORMATTER = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
// Note: RFC822 dates must not be localized!
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册