Created
June 30, 2016 20:04
-
-
Save dnozay/6eb65557fb499c9625d9eee0ee2a55cb to your computer and use it in GitHub Desktop.
formatting an exception.
This file contains hidden or 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
// http://stackoverflow.com/questions/1149703/how-can-i-convert-a-stack-trace-to-a-string | |
def formatStackTraceString(t: Throwable): String = { | |
s""" | |
| exception: ${t.getClass.getName} | |
| message: ${t.getMessage} | |
| cause: ${t.getCause} | |
| stacktrace: | |
| ${indent(t.getStackTraceString, spaces = 4)} | |
""".stripMargin | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment