Add missing error messages

pull/1/head
yflory 4 years ago
parent fcfcb3dca6
commit d17265f2eb

@ -2505,6 +2505,9 @@ define([
} else if (err.type === 'ERESTRICTED') {
msg = Messages.restrictedError;
if (toolbar && typeof toolbar.failed === "function") { toolbar.failed(true); }
} else if (err.type === 'HASH_NOT_FOUND' && priv.isHistoryVersion) {
msg = Messages.oo_deletedVersion;
if (toolbar && typeof toolbar.failed === "function") { toolbar.failed(true); }
}
var sframeChan = common.getSframeChannel();
sframeChan.event('EV_SHARE_OPEN', {hidden: true});
@ -3407,6 +3410,7 @@ define([
});
make(val, function (err) {
clearTimeout(to);
$input.val('');
if (err) {
return void UI.alert(Messages.snapshots_cantMake);
}

@ -340,6 +340,7 @@ define([
if (!val) { return true; }
config.makeSnapshot(val, function (err) {
if (err) { return; }
$input.val('');
UI.log(Messages.saved);
}, {
hash: getVersion(),

@ -1470,6 +1470,11 @@ define([
Store.getPadMetadata(null, {
channel: data.channel
}, waitFor(function (md) {
if (md && md.rejected) {
postMessage(clientId, "PAD_ERROR", {type: "ERESTRICTED"});
waitFor.abort();
return;
}
validateKey = md.validateKey;
}));
}).nThen(function () {
@ -1482,6 +1487,11 @@ define([
postMessage(clientId, "PAD_ERROR", obj.error);
return;
}
var msgs = obj.messages || [];
if (msgs.length && msgs[msgs.length - 1].serverHash !== data.versionHash) {
postMessage(clientId, "PAD_ERROR", {type: "HASH_NOT_FOUND"});
return;
}
postMessage(clientId, "PAD_CONNECT", {
myID: fakeNetflux,
id: data.channel,

@ -407,6 +407,7 @@ define([
};
var sent = config.setLastMetadata(md);
if (!sent) { return void UI.alert(Messages.snapshots_cantMake); }
$input.val('');
refreshBar();
} catch (e) {
console.error(e);

Loading…
Cancel
Save