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:
parent
8ff1d05df3
commit
f1bfb84b4b
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user