Skip to content
Permalink
Browse files

Handle Error From Coinmarketcap API

  • Loading branch information...
piavgh committed Feb 13, 2019
1 parent 0b8c8b6 commit dd9f092e21b106babccde1d92b19e7ebff334f86
Showing with 5 additions and 0 deletions.
  1. +5 −0 services/coinmarketcap/getMarketQuotes.js
@@ -11,6 +11,11 @@ export const getMarketQuotes = async (baseTokenSymbol = null, quoteTokenSymbol =
headers: { 'X-CMC_PRO_API_KEY': process.env.COINMARKETCAP_API_KEY },
})

if (response.data.status.error_code !== 0) {
console.log(response.data.status.error_message)
return
}

return response.data.data
} catch (err) {
console.log(err)

0 comments on commit dd9f092

Please sign in to comment.
You can’t perform that action at this time.