2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 19:39:07 +00:00

fix: better message on format error

This commit is contained in:
18alantom 2021-12-29 17:22:07 +05:30
parent 8fcfd94890
commit 021d1d2a39

View File

@ -63,7 +63,14 @@ function getCurrency(df, doc) {
function formatCurrency(value, df, doc) {
const currency = getCurrency(df, doc);
const valueString = numberFormat.formatCurrency(value);
let valueString;
try {
valueString = numberFormat.formatCurrency(value);
} catch (err) {
err.message += ` value: '${value}', type: ${typeof value}`;
console.error(df);
throw err;
}
const currencySymbol = frappe.currencySymbols[currency];
if (currencySymbol) {