Skip to content

Commit

Permalink
Fix converters after main merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dickwolff committed Feb 1, 2024
1 parent 1e425a0 commit 99f6223
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/converters/degiroConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ export class DeGiroConverter extends AbstractConverter {
this.progress);
}
catch (err) {
throw err;
this.logQueryError(record.isin || record.product, idx);
return errorCallback(err);
}

// Log whenever there was no match found.
Expand Down
6 changes: 3 additions & 3 deletions src/converters/degiroConverterV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class DeGiroConverterV2 extends AbstractConverter {
/**
* @inheritdoc
*/
public processFile(inputFile: string, callback: any): void {
public processFileContents(inputFile: string, successCallback: any, errorCallback: any): void {

// Read file contents of the CSV export.
const csvFile = fs.readFileSync(inputFile, "utf-8");
Expand Down Expand Up @@ -101,7 +101,7 @@ export class DeGiroConverterV2 extends AbstractConverter {
}
catch (err) {
this.logQueryError(record.isin || record.product, idx);
throw err;
return errorCallback(err);
}

// Log whenever there was no match found.
Expand Down Expand Up @@ -145,7 +145,7 @@ export class DeGiroConverterV2 extends AbstractConverter {

this.progress.stop();

callback(result);
successCallback(result);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/converters/finpensionConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class FinpensionConverter extends AbstractConverter {
}
catch (err) {
this.logQueryError(record.isin || record.assetName, idx + 2);
throw err;
return errorCallback(err);
}

// Log whenever there was no match found.
Expand Down
6 changes: 3 additions & 3 deletions src/converters/schwabConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class SchwabConverter extends AbstractConverter {
/**
* @inheritdoc
*/
public processFile(inputFile: string, callback: any): void {
public processFileContents(inputFile: string, successCallback: any, errorCallback: any): void {

// Read file contents of the CSV export.
const csvFile = fs.readFileSync(inputFile, "utf-8");
Expand Down Expand Up @@ -145,7 +145,7 @@ export class SchwabConverter extends AbstractConverter {
}
catch (err) {
this.logQueryError(record.symbol || record.description, idx + 2);
throw err;
return errorCallback(err);
}

// Log whenever there was no match found.
Expand Down Expand Up @@ -187,7 +187,7 @@ export class SchwabConverter extends AbstractConverter {

this.progress.stop()

callback(result);
successCallback(result);
});

// Catch any error.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/converters/trading212Converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class Trading212Converter extends AbstractConverter {
}
catch (err) {
this.logQueryError(record.isin || record.ticker || record.name, idx + 2);
throw err;
return errorCallback(err);
}

// Log whenever there was no match found.
Expand Down

0 comments on commit 99f6223

Please sign in to comment.