Commit 6d76557c authored by Roque's avatar Roque

erp5_officejs: handle offline error when synchronizing

parent e9831033
...@@ -72,19 +72,27 @@ ...@@ -72,19 +72,27 @@
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("reload", "reload") .declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareService(function () { .declareService(function () {
var gadget = this; var gadget = this;
if (gadget.state.auto_repair) { return RSVP.Queue()
return repair_and_redirect(gadget) .push(function () {
.push(undefined, function (e) { if (gadget.state.auto_repair) {
if (e.name === "ReplicateReport") { return repair_and_redirect(gadget);
throw new Error(e.toString()); }
} })
throw e; .push(undefined, function (error) {
}); console.log(error);
} if (error && error.target && error.target.status === 0) {
return gadget.notifySubmitted({
message: "Error: cant't sync while offline",
status: "error"
});
}
throw error;
});
}); });
}(window, RSVP, rJS)); }(window, RSVP, rJS));
\ No newline at end of file
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>969.42224.7621.358</string> </value> <value> <string>978.63074.34178.45346</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1534757989.87</float> <float>1570464833.09</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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