dave08
08/16/2018, 10:36 AMDeactivated User
08/16/2018, 10:36 AMdave08
08/16/2018, 10:37 AMdave08
08/16/2018, 10:38 AMdocker run --rm -v gradle-cache:/home/gradle/.gradle -v "$PWD":/home/gradle/project -w /home/gradle/project gradle:4.7.0-jdk8-alpine gradle shadowJar --no-daemon --console plain
dave08
08/16/2018, 10:50 AMDeactivated User
08/16/2018, 10:54 AMDeactivated User
08/16/2018, 10:54 AMcy
08/16/2018, 11:06 AMcy
08/16/2018, 11:07 AMdave08
08/16/2018, 11:19 AMclass KtorJsonRpcClient(val client: HttpClient, val moshi: Moshi, val endpoint: String): JsonRpcClient {
override suspend fun <R> invoke(method: String, params: Any, resultType: Type): R {
val stringResponse = client.get<String>(endpoint) {
contentType(ContentType.Application.Json)
body = JsonRpcRequest(1, method, params)
}
val responseType = Types.newParameterizedType(JsonRpcResponse::class.java, resultType)
val response = moshi.adapter<JsonRpcResponse<R>>(responseType).fromJson(stringResponse)!!
if (response.result != null)
return response.result
else
throw response.error!!.run { JsonRpcException(code, message, data) }
}
}
dave08
08/16/2018, 11:20 AMcy
08/16/2018, 11:21 AMdave08
08/16/2018, 11:28 AMInvocationTargetException
at the beginning of the stack trace 🤔cy
08/16/2018, 11:32 AMInvocationTargetException
is caused by reflection invocation of the main module functiondave08
08/16/2018, 11:34 AM