Skip to content

Commit 2ce6abf

Browse files
committed
added logging to the CSVURLModule; tested with local config
1 parent 2e4e350 commit 2ce6abf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/modules/CSVURLModule.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,22 @@ class CSVURLModule {
1616
// If data is already cached, this function does nothing
1717
async fillDataCache() {
1818
if (!this.data) {
19-
const csvData = await axios.get(this.url).then((res) => res.data);
19+
logger.debug('Filling the data cache of CSVURLModule');
20+
const csvData = await axios.get(this.url)
21+
.then((res) => res.data)
22+
.catch((e) => {
23+
logger.error('Error occurred when getting CSV data using url');
24+
throw e;
25+
});
26+
logger.debug('Web request successful');
2027
// Parse then normalize the data
2128
const parsedData = parse(csvData, {
2229
columns: (header) => header.map((column) => stringNormalizer(column)),
2330
bom: true,
2431
});
32+
logger.debug('Data parsing successful');
2533
this.data = normalizeEmptyValues(parsedData, this.unalterableColumns);
34+
logger.debug('Normalization of empty values successful');
2635
}
2736
}
2837

0 commit comments

Comments
 (0)