Created
February 14, 2012 13:27
-
-
Save sifue/1826753 to your computer and use it in GitHub Desktop.
Javaの例外のスタックトレースをStringに変換するスニペット ref: http://qiita.com/items/2486
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// エラーのスタックトレースを表示 | |
StringWriter sw = new StringWriter(); | |
PrintWriter pw = new PrintWriter(sw); | |
e.printStackTrace(pw); | |
pw.flush(); | |
String str = sw.toString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment