Commit afefd518 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: XXX do not crash if a document can not be accessed

parent e5bb9a93
...@@ -274,6 +274,23 @@ and handling data send&receive. ...@@ -274,6 +274,23 @@ and handling data send&receive.
new_state.erp5_document = JSON.stringify(new_state.erp5_document); new_state.erp5_document = JSON.stringify(new_state.erp5_document);
return gadget.changeState(new_state); return gadget.changeState(new_state);
})
.push(undefined, function (error) {
if ((error instanceof jIO.util.jIOError) &&
(error.status_code === 404)) {
// If user is authenticated, hal style return 404 in case of unauthorized
// XXX use 403 instead?
// redirect user to the parent page with a message?
// XXX couscous
return gadget.notifySubmitted({
'message': error.message,
'status': 'error'
})
.push(function () {
return gadget.redirect({command: 'history_previous'});
});
}
throw error;
}); });
}) })
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>999.25844.45625.48025</string> </value> <value> <string>996.45584.23925.17988</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1649336938.64</float> <float>1638984141.13</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