debug: log raw response bytes for failed RPC calls

This commit is contained in:
Mavis
2026-06-03 10:23:02 +00:00
parent 639d265278
commit 273dcd1408
+7
View File
@@ -225,6 +225,13 @@ export class KRPCClient {
}
sendMessage(this.rpcSocket, KRPC.Request, { calls: [call] });
const raw = await recvRawMessage(this.rpcSocket);
if (process.env.KRPC_DEBUG) {
// eslint-disable-next-line no-console
console.log(
`[krpc-client] ${req.service}.${req.procedure} response (${raw.length} bytes):`,
Buffer.from(raw).toString('hex'),
);
}
const response = decodeMessage<{
// The error/result fields are `bytes` in the kRPC schema. They
// carry a serialized Error or value sub-message that we have