2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

fix: display a better error message

This commit is contained in:
18alantom 2021-12-29 11:23:16 +05:30
parent 0c556ff8a4
commit e249b033f1

View File

@ -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;
}