Skip to content

Instantly share code, notes, and snippets.

@pauldijou
Forked from gbougeard/gist:10017042
Last active August 29, 2015 13:58
Show Gist options
  • Save pauldijou/10017072 to your computer and use it in GitHub Desktop.
Save pauldijou/10017072 to your computer and use it in GitHub Desktop.
Future.sequence(futures).map(results => {
val jsonIssues:List[Issue] = results.map(result => {
play.Logger.debug(result.json.toString())
result.json.validate[Issue] match {
case s: JsSuccess[Issue] => Some(s.get)
case e: JsError => {
Logger.debug("Errors: " + JsError.toFlatJson(e).toString())
None
}
}
}).collect { case Some(i) => i }
play.Logger.debug(s"$jsonIssues")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment