Last active
May 27, 2016 15:44
-
-
Save marcomorain/1c45e8dea6a977e315c6592faf2565b5 to your computer and use it in GitHub Desktop.
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
| 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