From e249b033f1f22a96c53e0d3fb397e7cae7b5f6a2 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Wed, 29 Dec 2021 11:23:16 +0530 Subject: [PATCH] fix: display a better error message --- backends/database.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backends/database.js b/backends/database.js index cbb6ec22..b94e4c31 100644 --- a/backends/database.js +++ b/backends/database.js @@ -359,8 +359,15 @@ module.exports = class Database extends Observable { getDocFormattedValues(field, value) { // format for usage, not going into the db - if (field.fieldtype === 'Currency') { - return frappe.pesa(value); + try { + if (field.fieldtype === 'Currency') { + return frappe.pesa(value); + } + } catch (err) { + err.message += ` value: '${value}' of type: ${typeof value}, fieldname: '${ + field.fieldname + }', label: '${field.label}'`; + throw err; } return value; }