We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9231a41 commit 42a7b20Copy full SHA for 42a7b20
src/api/utils/coingecko.ts
@@ -71,7 +71,17 @@ export class CoinGeckoDataService {
71
const vsCurrenciesParams = `vs_currencies=${params.vsCurrencies.join(',')}`;
72
const url = `${endpoint}${contractAddressParams}&${vsCurrenciesParams}`;
73
74
- const response = await axios.get(url);
+ let response;
75
+ try {
76
+ response = await axios.get(url);
77
+ } catch (e) {
78
+ // If coingecko fails, set prices to zero
79
+ response = { data: {} };
80
+ for (const address of params.contractAddresses) {
81
+ response.data[address] = {};
82
+ response.data[address][params.vsCurrencies[0]] = 0.00;
83
+ }
84
85
return response.data;
86
}
87
0 commit comments