Tucsky / aggr

Cryptocurrency trades aggregator
https://charts.aggr.trade/
GNU General Public License v3.0
801 stars 232 forks source link

[BUG] Error thrown when no more data to fetch #372

Open adeacetis opened 9 months ago

adeacetis commented 9 months ago

image

HistoricalService is currently throwing an error when it reaches the end of the fetched data's range.

The desired behavior is for the HistoricalService to notify the user when it has fetched all available data and is stopping, instead of throwing an error.

if (!json.results.length) {
  throw new Error('No more data')
}

Of course, if the service fails it should throw.