From f1bfb84b4bd62ff2f0d192a66960f8af0e7283e9 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 8 Jul 2020 18:44:38 -0300 Subject: [PATCH] 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. --- app/scripts/metamask-controller.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index be23c5a69..6fe276228 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -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()