Skip to content

Instantly share code, notes, and snippets.

@nanlabsweb
Created April 5, 2018 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanlabsweb/555e3a1e331d728e7cf78abe8a38e35f to your computer and use it in GitHub Desktop.
Save nanlabsweb/555e3a1e331d728e7cf78abe8a38e35f to your computer and use it in GitHub Desktop.
Sync pets with exception handling.
suspend fun syncPets(): String {
var message = "Congratulations!!"
try {
async { repository.syncPets() }.await()
} catch (e: Exception) {
message = e.message!!
}
return message
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment