Skip to content

Instantly share code, notes, and snippets.

@marcomorain
Last active May 27, 2016 15:44
Show Gist options
  • Select an option

  • Save marcomorain/1c45e8dea6a977e315c6592faf2565b5 to your computer and use it in GitHub Desktop.

Select an option

Save marcomorain/1c45e8dea6a977e315c6592faf2565b5 to your computer and use it in GitHub Desktop.
fun <T> Capture(block: () -> T): T {
try {
return block.invoke()
} catch (e: Exception) {
Sentry.captureException(e)
throw e
}
}
Capture {
// capture any exceptions which happen during execution of this block
1/0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment