diff --git a/app/components/Views/BrowserTab/index.js b/app/components/Views/BrowserTab/index.js index f599b6aac9a..a429d951288 100644 --- a/app/components/Views/BrowserTab/index.js +++ b/app/components/Views/BrowserTab/index.js @@ -1651,7 +1651,7 @@ export class BrowserTab extends PureComponent { this.setState({ showApprovalDialog: false, showApprovalDialogHostname: undefined }); this.approvalRequest && this.approvalRequest.reject && - this.approvalRequest.reject('User rejected account access'); + this.approvalRequest.reject(new Error('User rejected account access')); }; renderApprovalModal = () => { diff --git a/app/components/Views/ImportWallet/index.js b/app/components/Views/ImportWallet/index.js index 3feed28ca73..a1660dcf740 100644 --- a/app/components/Views/ImportWallet/index.js +++ b/app/components/Views/ImportWallet/index.js @@ -172,7 +172,7 @@ class ImportWallet extends PureComponent { } catch (e) { if (!firstAttempt) { this.props.navigation.goBack(); - if (e.toString() === 'sync-timeout') { + if (e.message === 'Sync::timeout') { Alert.alert( strings('sync_with_extension.outdated_qr_code'), strings('sync_with_extension.outdated_qr_code_desc') diff --git a/app/components/Views/SyncWithExtension/index.js b/app/components/Views/SyncWithExtension/index.js index 1497bfd66e4..5d7ead5907a 100644 --- a/app/components/Views/SyncWithExtension/index.js +++ b/app/components/Views/SyncWithExtension/index.js @@ -151,7 +151,7 @@ class SyncWithExtension extends PureComponent { } catch (e) { if (!firstAttempt) { this.props.navigation.goBack(); - if (e.toString() === 'sync-timeout') { + if (e.message === 'Sync::timeout') { Alert.alert( strings('sync_with_extension.outdated_qr_code'), strings('sync_with_extension.outdated_qr_code_desc') diff --git a/app/core/WalletConnect.js b/app/core/WalletConnect.js index 36b0c4d200a..6d867be8184 100644 --- a/app/core/WalletConnect.js +++ b/app/core/WalletConnect.js @@ -283,7 +283,7 @@ class WalletConnect { }); hub.on('walletconnectSessionRequest::rejected', peerId => { if (peerInfo.peerId === peerId) { - reject(false); + reject(new Error('walletconnectSessionRequest::rejected')); } }); }); diff --git a/app/util/blockies.js b/app/util/blockies.js index b788625f493..f99eca95ac3 100644 --- a/app/util/blockies.js +++ b/app/util/blockies.js @@ -325,7 +325,7 @@ function buildOpts(opts) { if (!opts.seed) { - throw 'No seed provided'; + throw new Error('No seed provided'); } seedrand(opts.seed); diff --git a/app/util/syncWithExtension.js b/app/util/syncWithExtension.js index 780cdd7d51f..c37c1c19f66 100644 --- a/app/util/syncWithExtension.js +++ b/app/util/syncWithExtension.js @@ -59,8 +59,9 @@ export default class PubNubWrapper { () => { setTimeout(() => { if (this.timeout) { - Logger.error('Sync::timeout'); - reject('sync-timeout'); + const error = new Error('Sync::timeout'); + Logger.error(error); + reject(error); } else { resolve(); }