Created
January 16, 2015 17:34
-
-
Save maiha/c0bbbbfa6443cf29ef49 to your computer and use it in GitHub Desktop.
Seq[Try[A]]
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
| val trys: Seq[Try[CreateChatRequest]] = foo | |
| trys.find(_.isFailure) match { | |
| case Some(error) => ChatsCreateFailed(sid, tid, error.toString) | |
| case None => | |
| val reqs = trys.map(_.get) | |
| store.addChats(sid, tid, reqs) match { | |
| case Success(chats) => ChatsCreateFinished(sid, tid, chats) | |
| case Failure(error) => ChatsCreateFailed(sid, tid, error.toString) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment