Skip to content

Commit 4425097

Browse files
author
Leonor Boga
authored
[Kaizen] Add extra info data from JsonRpcErrors to the log (#1027)
1 parent 70cf7cf commit 4425097

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/scala/io/iohk/ethereum/jsonrpc/server/controllers/JsonRpcBaseController.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ trait JsonRpcBaseController {
6262

6363
handleFn(request)
6464
.flatTap {
65-
case JsonRpcResponse(_, _, Some(JsonRpcError(code, message, _)), _) =>
65+
case JsonRpcResponse(_, _, Some(JsonRpcError(code, message, extraData)), _) =>
6666
Task {
6767
log.error(
68-
s"JsonRpcError from request: ${request.toStringWithSensitiveInformation} - response code: $code and message: $message"
68+
s"JsonRpcError from request: ${request.toStringWithSensitiveInformation} - response code: $code and message: $message. " +
69+
s"${extraData.map(data => s"Extra info: ${data.values}")}"
6970
)
7071
JsonRpcControllerMetrics.MethodsErrorCounter.increment()
7172
}

0 commit comments

Comments
 (0)