Created
December 21, 2012 19:29
-
-
Save venkatperi/4355172 to your computer and use it in GitHub Desktop.
Report exceptions with Groovy Markup Builders
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
def reportError = { msg, e -> | |
new StreamingMarkupBuilder( ).bindNode { | |
exception( message: e.message, detail: msg ) { | |
stackTrace { | |
e?.stackTrace?.each { | |
at( file: it?.fileName, className: it?.className, method: it?.methodName, | |
line: it?.lineNumber ) { | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment