Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Controling API response production error
Browse files Browse the repository at this point in the history
  • Loading branch information
Genar Trias Ortiz committed Dec 21, 2017
1 parent ca1fe41 commit b2a5f99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/config.local.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module.exports = {
port: process.env.PORT || 3000,
bittrex: {
apikey: '',
apisecret: ''
}
}
4 changes: 4 additions & 0 deletions server/exchanges/bittrex.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ module.exports = class BittrexExchange {
cb(err)
}

if (!data) {
cb(new Error('No response from Bittrex API'))
}

cb(null, data.result)
})
}
Expand Down

0 comments on commit b2a5f99

Please sign in to comment.