We should not fail response parsing in case null id of response

This commit is contained in:
a10zn8
2023-05-30 18:56:43 +04:00
parent d83e2f1c6b
commit f626cf61cb

View File

@@ -109,7 +109,8 @@ abstract class ResponseParser<T> {
} else if (parser.currentToken() == JsonToken.VALUE_STRING) {
JsonRpcResponse.StringId(parser.text)
} else {
throw IllegalStateException("Not a string or number: ${parser.currentToken()}")
log.warn("Invalid id type: ${parser.currentToken()}")
return JsonRpcResponse.NumberId(0)
}
}