[IMP] web: log user_error as info instead of error

Since a console.error will mark a tests as failed, logging user error
as info will allow to test a flow with user error without
marking the runbot red
This commit is contained in:
XavierDo
2018-09-14 13:56:32 +02:00
parent b0cc678f17
commit 71663b7f57
+5 -1
View File
@@ -29,7 +29,11 @@ function genericJsonRpc (fct_name, params, settings, fct) {
core.bus.trigger('rpc:result', data, result);
if (result.error !== undefined) {
if (result.error.data.arguments[0] !== "bus.Bus not available in test mode") {
console.error("Server application error", JSON.stringify(result.error));
if (result.error.data.exception_type === "user_error") {
console.log("Server application error", JSON.stringify(result.error));
} else {
console.error("Server application error", JSON.stringify(result.error));
}
}
return $.Deferred().reject("server", result.error);
} else {