Created
June 7, 2019 21:57
-
-
Save varmas/9a48a51389a95c13f00cf30ec97403ca to your computer and use it in GitHub Desktop.
exception handler wrapper
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
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