1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Throw error upon currency update failure (#8944)

The currency rate controller is updated upon each network change, as
the "native currency" is network-dependent and might have changed.
However, any thrown errors were being caught and passed to an empty
callback.

The errors are now re-thrown in the callback. As a result, the errors
will now be printed to the console and sent to Sentry.
This commit is contained in:
Mark Stacey 2020-07-08 18:44:38 -03:00 committed by GitHub
parent 8ff1d05df3
commit f1bfb84b4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -267,7 +267,14 @@ export default class MetamaskController extends EventEmitter {
})
this.networkController.on('networkDidChange', () => {
this.setCurrentCurrency(this.currencyRateController.state.currentCurrency, function () {})
this.setCurrentCurrency(
this.currencyRateController.state.currentCurrency,
(error) => {
if (error) {
throw error
}
}
)
})
this.networkController.lookupNetwork()