Commit d97ed23d authored by Jérome Perrin's avatar Jérome Perrin

fixup! GUI: Display an informative error message when saving to jIO fails

This error message was displayed for all errors, such as timeout or
server errors.
We only want to catch errors in jIO.put
parent f7692198
...@@ -80,6 +80,12 @@ ...@@ -80,6 +80,12 @@
"_attachment": "body.json", "_attachment": "body.json",
"_data": JSON.stringify(data, null, 2), "_data": JSON.stringify(data, null, 2),
"_mimetype": "application/json" "_mimetype": "application/json"
}).fail(function(reason){
alert("Could not save simulation results.Please check the simulation parameters or try to delete some models.\n\nError was:" + reason);
return gadget.whoWantsToDisplayThisDocument(
gadget.props.jio_key,
"view"
);
}); });
}) })
.push(function () { .push(function () {
...@@ -87,14 +93,6 @@ ...@@ -87,14 +93,6 @@
gadget.props.jio_key, gadget.props.jio_key,
"view_result" "view_result"
); );
}, function(reason){
// Very likely, we exceeded the quota of the local storage.
// Let's handle it with a more informative message.
alert("Could not save simulation results.Please check the simulation parameters or try to delete some models.\n\nError was:" + reason);
return gadget.whoWantsToDisplayThisDocument(
gadget.props.jio_key,
"view"
);
}) })
.push(function (url) { .push(function (url) {
return gadget.pleaseRedirectMyHash(url); return gadget.pleaseRedirectMyHash(url);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment