wechaty/puppet-service

[Donut] Error: 2 UNKNOWN: can not load message payload or url of the payload.

Closed this issue · 0 comments

从padplus转换donut后经常出现接收图像时无法解析的现象,该场景是随机、频繁出现的,和文件\图片的大小或者格式无关。

Error: 2 UNKNOWN: can not load message payload or url of the payload.
    at Object.exports.createStatusError (/node_modules/_grpc@1.24.4@grpc/src/common.js:91:15)
    at ClientReadableStream._emitStatusIfDone (/node_modules/_grpc@1.24.4@grpc/src/client.js:233:26)
    at ClientReadableStream._receiveStatus (/node_modules/_grpc@1.24.4@grpc/src/client.js:211:8)
    at Object.onReceiveStatus (/node_modules/_grpc@1.24.4@grpc/src/client_interceptors.js:1277:15)
    at InterceptingListener._callNext (/node_modules/_grpc@1.24.4@grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/node_modules/_grpc@1.24.4@grpc/src/client_interceptors.js:618:8)
    at /node_modules/_grpc@1.24.4@grpc/src/client_interceptors.js:1033:24 {
  code: 2,
  metadata: Metadata { _internal_repr: {}, flags: 0 },
  details: 'can not load message payload or url of the payload.'
}

代码:

const msgFile = await msg.toFileBox();
let filename = msgFile.name.trim(), filedir = config.media.path;

if (filedir && filedir.length && !fs.existsSync(filedir)) fs.mkdirSync(filedir, {'recursive': true});
filedir = path.join(filedir, filename);
msgFile.toFile(filedir, true);

我应该如何解决?