[FIX] debug tools: do not crash on non json-stringifiable props

closes #595
This commit is contained in:
Géry Debongnie
2020-01-08 16:18:40 +01:00
committed by aab-odoo
parent 49931104a1
commit 4a0d04e4ae
3 changed files with 65 additions and 2 deletions
+6 -1
View File
@@ -35,7 +35,12 @@
});
function toStr(obj) {
let str = JSON.stringify(obj || {});
let str;
try {
str = JSON.stringify(obj || {});
} catch (e) {
str = "<JSON error>";
}
if (str.length > 200) {
str = str.slice(0, 200) + "...";
}