Skip to content

Commit

Permalink
Remove redundant error logging
Browse files Browse the repository at this point in the history
The `_fetchAll` function is expected to return values, so catching
errors and logging them only results in an additional error at the
place where `_fetchAll` is called. It's better instead to let the
error get thrown as normal.

In this particular case `_fetchAll` is only called in once place. The
error is still correctly caught and logged (in the `_update` function)
  • Loading branch information
Gudahtt committed Sep 11, 2019
1 parent dbbf698 commit 4599ace
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/scripts/controllers/incoming-transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,8 @@ class IncomingTransactionsController {
}

async _fetchAll (address, fromBlock, networkType) {
try {
const fetchedTxResponse = await this._fetchTxs(address, fromBlock, networkType)
return this._processTxFetchResponse(fetchedTxResponse)
} catch (err) {
log.error(err)
}
const fetchedTxResponse = await this._fetchTxs(address, fromBlock, networkType)
return this._processTxFetchResponse(fetchedTxResponse)
}

async _fetchTxs (address, fromBlock, networkType) {
Expand Down

0 comments on commit 4599ace

Please sign in to comment.