Skip to content

Commit

Permalink
server: Log invalid response details on XSNService
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC committed Feb 23, 2019
1 parent 9dd24a4 commit dbd1f28
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/app/com/xsn/explorer/services/XSNService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,15 @@ class XSNServiceRPCImpl @Inject() (
.filter(_.status == 200)
.flatMap { r => Try(r.json).toOption }
.flatMap { json =>
if (logger.isDebugEnabled) {
val x = (json \ "result").validate[A]
x.asEither.left.foreach { errors =>
val msg = errors
.map { case (path, error) => path.toJsonString -> error.toString() }
.mkString(", ")
logger.debug(s"Failed to decode result, errors = ${msg}")
}
}
(json \ "result")
.asOpt[A]
.map { Good(_) }
Expand Down

0 comments on commit dbd1f28

Please sign in to comment.