Skip to content

Instantly share code, notes, and snippets.

@varmas
Created June 7, 2019 21:57
Show Gist options
  • Save varmas/9a48a51389a95c13f00cf30ec97403ca to your computer and use it in GitHub Desktop.
Save varmas/9a48a51389a95c13f00cf30ec97403ca to your computer and use it in GitHub Desktop.
exception handler wrapper
private def handleExceptions[T](fn: => T, message: String): T = {
try {
fn
} catch {
case ex: Exception =>
println(message)
throw ex
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment