From c6a9a89e5c7115ad1073521286882e82e0f68ab7 Mon Sep 17 00:00:00 2001 From: Leonor Boga Date: Thu, 24 Jun 2021 12:40:02 +0200 Subject: [PATCH] [Kaizen] Add extra info data from JsonRpcErrors to the log --- .../jsonrpc/server/controllers/JsonRpcBaseController.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/scala/io/iohk/ethereum/jsonrpc/server/controllers/JsonRpcBaseController.scala b/src/main/scala/io/iohk/ethereum/jsonrpc/server/controllers/JsonRpcBaseController.scala index b68dfbfe47..1040293943 100644 --- a/src/main/scala/io/iohk/ethereum/jsonrpc/server/controllers/JsonRpcBaseController.scala +++ b/src/main/scala/io/iohk/ethereum/jsonrpc/server/controllers/JsonRpcBaseController.scala @@ -62,10 +62,11 @@ trait JsonRpcBaseController { handleFn(request) .flatTap { - case JsonRpcResponse(_, _, Some(JsonRpcError(code, message, _)), _) => + case JsonRpcResponse(_, _, Some(JsonRpcError(code, message, extraData)), _) => Task { log.error( - s"JsonRpcError from request: ${request.toStringWithSensitiveInformation} - response code: $code and message: $message" + s"JsonRpcError from request: ${request.toStringWithSensitiveInformation} - response code: $code and message: $message. " + + s"${extraData.map(data => s"Extra info: ${data.values}")}" ) JsonRpcControllerMetrics.MethodsErrorCounter.increment() }