Commit 76ed33d3 authored by Roque's avatar Roque

erp5_web_monitoring: fix error catch

parent ff624fd2
/*global window, rJS */
/*global window, rJS, jIO */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS) {
(function (window, rJS, jIO) {
"use strict";
rJS(window)
......@@ -16,9 +16,13 @@
var gadget = this;
return gadget.jio_remove(options.jio_key)
.push(function () {
return gadget.notifySubmitted({message: "Document Deleted", status: "success"})
return gadget.notifySubmitted({message: "Document Deleted", status: "success"});
}, function (error) {
return gadget.notifySubmitted({message: error.message, status: "error"})
if (error instanceof jIO.util.jIOError) {
return gadget.notifySubmitted({message: error.message, status: "error"});
} else {
throw error;
}
})
.push(function () {
return gadget.redirect({command: 'change', options: {
......@@ -26,4 +30,4 @@
}});
});
}, {mutex: 'render'});
}(window, rJS));
}(window, rJS, jIO));
\ No newline at end of file
......@@ -260,7 +260,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1020.22291.41890.38485</string> </value>
<value> <string>1020.29408.38904.22562</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -280,7 +280,7 @@
</tuple>
<state>
<tuple>
<float>1730318970.28</float>
<float>1730743757.03</float>
<string>UTC</string>
</tuple>
</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