Skip to content

Instantly share code, notes, and snippets.

@fizzy33
Created July 3, 2013 17:17
Show Gist options
  • Save fizzy33/5920667 to your computer and use it in GitHub Desktop.
Save fizzy33/5920667 to your computer and use it in GitHub Desktop.
def s = new Singleton()
try {
log("--log-- started")
s.main()
} catch (e) {
log("--log-- " + throwableToString(e))
} finally {
log("--log-- done")
}
class Singleton {
String throwableToString(Throwable th) {
def sw = new java.io.StringWriter()
def pw = new java.io.PrintWriter(sw)
th.printStackTrace(pw)
sw.toString()
}
def main() {
ask("hello world",[
attempts: 5,
bargein: true,
choices: "1, 2, 3, #",
mode: "dtmf",
timeout: 6.0
])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment