From dbd1f28ff773665241c0372eb4cbe0307fa84755 Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Fri, 22 Feb 2019 18:12:03 -0700 Subject: [PATCH] server: Log invalid response details on XSNService --- server/app/com/xsn/explorer/services/XSNService.scala | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/app/com/xsn/explorer/services/XSNService.scala b/server/app/com/xsn/explorer/services/XSNService.scala index 056d26b..4031681 100644 --- a/server/app/com/xsn/explorer/services/XSNService.scala +++ b/server/app/com/xsn/explorer/services/XSNService.scala @@ -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(_) }