From e9b52c8d1bc084b688b4bb3892cb36964d743011 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Fri, 25 Feb 2022 14:14:25 +0530 Subject: [PATCH] fix: catch promise error --- src/dataImport.ts | 4 ++-- src/pages/DataImport.vue | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/dataImport.ts b/src/dataImport.ts index 8dc23dd95..197667e14 100644 --- a/src/dataImport.ts +++ b/src/dataImport.ts @@ -51,7 +51,7 @@ function formatValue(value: string, fieldtype: FieldType): unknown { return new Date(value); case FieldType.Currency: // @ts-ignore - return frappe.pesa(value); + return frappe.pesa(value || 0); case FieldType.Int: case FieldType.Float: { const n = parseFloat(value); @@ -364,9 +364,9 @@ export class Importer { } const doc = frappe.getNewDoc(this.doctype); - await doc.set(docObj); try { + await doc.set(docObj); await doc.insert(); if (this.shouldSubmit) { await doc.submit(); diff --git a/src/pages/DataImport.vue b/src/pages/DataImport.vue index 0e6e77b12..4e4e44adc 100644 --- a/src/pages/DataImport.vue +++ b/src/pages/DataImport.vue @@ -212,7 +212,7 @@ :key="'matrix-row-' + i" >