Skip to content

Instantly share code, notes, and snippets.

@dkomanov
Created May 24, 2020 16:19
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 dkomanov/5ffb80ef71991b8ea134868f6dcd6a0b to your computer and use it in GitHub Desktop.
Save dkomanov/5ffb80ef71991b8ea134868f6dcd6a0b to your computer and use it in GitHub Desktop.
[writing-async-app-in-scala-part-2] trivial example
def rpcCall: Future[Option[String]]
def reportException(e: Throwable): Unit
def getUrlSafe: Future[Option[String]] = {
rpcCall.recover {
case e: Throwable =>
reportException(e)
None
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment