|
@ -458,6 +458,15 @@ class XSNServiceRPCImpl @Inject() ( |
|
|
.filter(_.status == 200) |
|
|
.filter(_.status == 200) |
|
|
.flatMap { r => Try(r.json).toOption } |
|
|
.flatMap { r => Try(r.json).toOption } |
|
|
.flatMap { json => |
|
|
.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") |
|
|
(json \ "result") |
|
|
.asOpt[A] |
|
|
.asOpt[A] |
|
|
.map { Good(_) } |
|
|
.map { Good(_) } |
|
|