From 7e743945717993a44351ad9658d9d03c6019d21f Mon Sep 17 00:00:00 2001 From: mertmit Date: Wed, 2 Aug 2023 13:27:29 +0300 Subject: [PATCH] fix: parse error messages properly for at-import Signed-off-by: mertmit --- .../modules/jobs/jobs/at-import/at-import.processor.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts b/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts index bc9a247dad..dc4afc8b64 100644 --- a/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts @@ -1879,9 +1879,7 @@ export class AtImportProcessor { req: { user: syncDB.user, clientIp: '' }, }) .catch((e) => - e.response?.data?.msg - ? logBasic(`NOTICE: ${e.response.data.msg}`) - : console.log(e), + e.message ? logBasic(`NOTICE: ${e.message}`) : console.log(e), ), ); recordPerfStats(_perfStart, 'auth.projectUserAdd'); @@ -2469,12 +2467,12 @@ export class AtImportProcessor { await generateMigrationStats(aTblSchema); } } catch (e) { - if (e.response?.data?.msg) { + if (e.message) { T.event({ event: 'a:airtable-import:error', - data: { error: e.response.data.msg }, + data: { error: e.message }, }); - throw new Error(e.response.data.msg); + throw new Error(e.message); } throw e; }