Skip to content

Instantly share code, notes, and snippets.

@venkatperi
Created December 21, 2012 19:29
Show Gist options
  • Save venkatperi/4355172 to your computer and use it in GitHub Desktop.
Save venkatperi/4355172 to your computer and use it in GitHub Desktop.
Report exceptions with Groovy Markup Builders
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