How to use the common-errors.Http502Error function in common-errors

To help you get started, we’ve selected a few common-errors examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ubiq / shokku / src / server / services / ticker.js View on Github external
async symbol(symbol) {
    l.info(`TickerService - symbols() / Fetching request for current symbol: ${symbol}`)
    try {
      const res = await axios(CRYPTOCOMPARE_API)
      return this.toTickerJson(symbol, res.data)
    } catch (err) {
      l.error(`TickerService - symbols() / Error fetching request for current symbol: ${symbol} | ${err}`)
      throw errors.Http502Error({
        message: "Can't retrieve ticker list from original server. Please, try again later."
      })
    }
  }