Skip to content

Commit

Permalink
Merge branch 'error-handling' into 'main'
Browse files Browse the repository at this point in the history
fix: improve warning messages

See merge request flarenetwork/protocol-team/ftso-v2-example-value-provider!10
  • Loading branch information
adg-flare committed Nov 19, 2024
2 parents b968496 + b705f8b commit 9c14245
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/data-feeds/ccxt-provider-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,13 @@ export class CcxtFeed implements BaseDataFeed {

// If no valid prices were found, return undefined
if (prices.length === 0) {
this.logger.warn(`Unable to calculate median for ${JSON.stringify(feedId)}`);
this.logger.warn(`No prices found for ${JSON.stringify(feedId)}`);
return undefined;
}
// If single price found, return price
if (prices.length === 1) {
return prices[0];
}

// Sort the prices in ascending order
prices.sort((a, b) => a - b);
Expand Down

0 comments on commit 9c14245

Please sign in to comment.