Browse Source

fix: import service error logging

pull/7727/head
mertmit 10 months ago
parent
commit
91971a3418
  1. 11
      packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts

11
packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts

@ -1,5 +1,5 @@
import { isLinksOrLTAR, isVirtualCol, UITypes, ViewTypes } from 'nocodb-sdk'; import { isLinksOrLTAR, isVirtualCol, UITypes, ViewTypes } from 'nocodb-sdk';
import { Injectable } from '@nestjs/common'; import { Injectable, Logger } from '@nestjs/common';
import papaparse from 'papaparse'; import papaparse from 'papaparse';
import debug from 'debug'; import debug from 'debug';
import { elapsedTime, initTime } from '../../helpers'; import { elapsedTime, initTime } from '../../helpers';
@ -44,7 +44,8 @@ import { sanitizeColumnName } from '~/helpers';
@Injectable() @Injectable()
export class ImportService { export class ImportService {
private readonly debugLog = debug('nc:jobs:import'); protected readonly debugLog = debug('nc:jobs:import');
protected readonly logger = new Logger(ImportService.name);
constructor( constructor(
private tablesService: TablesService, private tablesService: TablesService,
@ -1515,7 +1516,7 @@ export class ImportService {
raw: true, raw: true,
}); });
} catch (e) { } catch (e) {
this.debugLog(e); this.logger.error(e);
} }
chunk = []; chunk = [];
parser.resume(); parser.resume();
@ -1536,7 +1537,7 @@ export class ImportService {
raw: true, raw: true,
}); });
} catch (e) { } catch (e) {
this.debugLog(e); this.logger.error(e);
} }
chunk = []; chunk = [];
} }
@ -1573,7 +1574,7 @@ export class ImportService {
}); });
lChunks[k] = []; lChunks[k] = [];
} catch (e) { } catch (e) {
this.debugLog(e); this.logger.error(e);
} }
} }
}; };

Loading…
Cancel
Save