Catch chainpad errors and display it in the UI

This commit is contained in:
yflory
2018-03-13 14:38:56 +01:00
parent b2df2ba341
commit e56d762409
6 changed files with 37 additions and 8 deletions

View File

@@ -346,7 +346,16 @@ define([
var content = stringifyInner(canvas.toDatalessJSON());
APP.realtime.contentUpdate(content);
try {
APP.realtime.contentUpdate(content);
} catch (e) {
APP.unrecoverable = true;
setEditable(false);
APP.toolbar.errorState(true, e.message);
var msg = Messages.chainpadError;
UI.errorLoadingScreen(msg, true, true);
console.error(e);
}
};
var addImageToCanvas = function (img) {