feat: safely parse exception

This commit is contained in:
Saqib Ansari 2022-03-16 10:53:39 +05:30 committed by GitHub
parent a1ae7fcbc8
commit 597bb2c7e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,8 +33,10 @@ frappe.ui.form.on("Rename Tool", {
let html = r.message.join("<br>");
if (r.exc) {
r.exc = JSON.parse(r.exc);
html += "<br>" + r.exc.join("<br>");
r.exc = frappe.utils.parse_json(r.exc);
if (Array.isArray(r.exc)) {
html += "<br>" + r.exc.join("<br>");
}
}
frm.get_field("rename_log").$wrapper.html(html);