From 71663b7f57676a5c06babb2917ec6e8bf0496679 Mon Sep 17 00:00:00 2001 From: XavierDo Date: Fri, 14 Sep 2018 11:04:07 +0200 Subject: [PATCH] [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 --- addons/web/static/src/js/core/ajax.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/core/ajax.js b/addons/web/static/src/js/core/ajax.js index d1bdd8d9d8d..45313b99428 100644 --- a/addons/web/static/src/js/core/ajax.js +++ b/addons/web/static/src/js/core/ajax.js @@ -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 {