Browse Source

Merge pull request #6113 from nocodb/fix/ati-error-handling

fix: parse error messages properly for at-import
pull/6134/head
navi 1 year ago committed by GitHub
parent
commit
8694bf2f49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

10
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

@ -1814,9 +1814,7 @@ export class AtImportProcessor {
req: { user: syncDB.user, clientIp: '' }, req: { user: syncDB.user, clientIp: '' },
}) })
.catch((e) => .catch((e) =>
e.response?.data?.msg e.message ? logBasic(`NOTICE: ${e.message}`) : console.log(e),
? logBasic(`NOTICE: ${e.response.data.msg}`)
: console.log(e),
), ),
); );
recordPerfStats(_perfStart, 'auth.projectUserAdd'); recordPerfStats(_perfStart, 'auth.projectUserAdd');
@ -2400,12 +2398,12 @@ export class AtImportProcessor {
await generateMigrationStats(aTblSchema); await generateMigrationStats(aTblSchema);
} }
} catch (e) { } catch (e) {
if (e.response?.data?.msg) { if (e.message) {
T.event({ T.event({
event: 'a:airtable-import:error', 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; throw e;
} }

Loading…
Cancel
Save