Skip to content

Instantly share code, notes, and snippets.

@rpiotrow
Created August 26, 2019 07:57
Show Gist options
  • Save rpiotrow/6846e4e31f444a7825ce9368e60e37e9 to your computer and use it in GitHub Desktop.
Save rpiotrow/6846e4e31f444a7825ce9368e60e37e9 to your computer and use it in GitHub Desktop.
when(val result = repository.findAll().attempt().unsafeRunSync()) {
is Either.Right -> call.respond(result.b)
else -> call.respond(HttpStatusCode.InternalServerError)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment