Send the error to chainpad when a patch is not sent

This commit is contained in:
yflory
2020-03-16 12:06:18 +01:00
parent 27c1291182
commit d69ad7c0e6
2 changed files with 6 additions and 2 deletions

View File

@@ -60,7 +60,8 @@ define([
});
chainpad.onMessage(function(message, cb) {
// -1 ==> no timeout, we may receive the callback only when we reconnect
sframeChan.query('Q_RT_MESSAGE', message, function (err) {
sframeChan.query('Q_RT_MESSAGE', message, function (_err, obj) {
var err = _err || (obj && obj.error);
if (!err) { evPatchSent.fire(); }
cb(err);
}, { timeout: -1 });