File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,22 @@ class CSVURLModule {
16
16
// If data is already cached, this function does nothing
17
17
async fillDataCache ( ) {
18
18
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' ) ;
20
27
// Parse then normalize the data
21
28
const parsedData = parse ( csvData , {
22
29
columns : ( header ) => header . map ( ( column ) => stringNormalizer ( column ) ) ,
23
30
bom : true ,
24
31
} ) ;
32
+ logger . debug ( 'Data parsing successful' ) ;
25
33
this . data = normalizeEmptyValues ( parsedData , this . unalterableColumns ) ;
34
+ logger . debug ( 'Normalization of empty values successful' ) ;
26
35
}
27
36
}
28
37
You can’t perform that action at this time.
0 commit comments