From f64fb3b96bd0211925149db2b9e745f65fad003c Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Sat, 17 Feb 2018 21:55:47 +0200 Subject: [PATCH] #389: improve error handling in AccountSwitcher --- src/components/accounts/AccountSwitcher.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/accounts/AccountSwitcher.js b/src/components/accounts/AccountSwitcher.js index 2b1e97c..69ec944 100644 --- a/src/components/accounts/AccountSwitcher.js +++ b/src/components/accounts/AccountSwitcher.js @@ -139,8 +139,11 @@ export class AccountSwitcher extends Component { loader.show(); this.props.switchAccount(account) - .then(() => this.props.onAfterAction()) + .finally(() => this.props.onAfterAction()) .then(() => this.props.onSwitch(account)) + // we won't sent any logs to sentry, because an error should be already + // handled by external logic + .catch((error) => console.warn('Error switching account', { error })) .finally(() => loader.hide()); };