Send the error to chainpad when a patch is not sent
This commit is contained in:
parent
27c1291182
commit
d69ad7c0e6
@ -1599,7 +1599,10 @@ define([
|
|||||||
onConnect: function (wc, sendMessage) {
|
onConnect: function (wc, sendMessage) {
|
||||||
channel.sendMessage = function (msg, cId, cb) {
|
channel.sendMessage = function (msg, cId, cb) {
|
||||||
// Send to server
|
// Send to server
|
||||||
sendMessage(msg, function () {
|
sendMessage(msg, function (err) {
|
||||||
|
if (err) {
|
||||||
|
return void cb({ error: err });
|
||||||
|
}
|
||||||
// Broadcast to other tabs
|
// Broadcast to other tabs
|
||||||
channel.pushHistory(CpNetflux.removeCp(msg), /^cp\|/.test(msg));
|
channel.pushHistory(CpNetflux.removeCp(msg), /^cp\|/.test(msg));
|
||||||
channel.bcast("PAD_MESSAGE", {
|
channel.bcast("PAD_MESSAGE", {
|
||||||
|
|||||||
@ -60,7 +60,8 @@ define([
|
|||||||
});
|
});
|
||||||
chainpad.onMessage(function(message, cb) {
|
chainpad.onMessage(function(message, cb) {
|
||||||
// -1 ==> no timeout, we may receive the callback only when we reconnect
|
// -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(); }
|
if (!err) { evPatchSent.fire(); }
|
||||||
cb(err);
|
cb(err);
|
||||||
}, { timeout: -1 });
|
}, { timeout: -1 });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user