From 477b74124d24c9497fafb0c976eba27712c69d79 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Sat, 21 Apr 2018 22:23:45 -0700 Subject: Revert "Fix UI getting stuck in Reveal Seed screen" This reverts commit 2c8156ebe91941309d49e8f8f1ed8e9d740bb9de. --- app/scripts/lib/config-manager.js | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 63d27c40e..34b603b96 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -102,6 +102,7 @@ ConfigManager.prototype.setShowSeedWords = function (should) { this.setData(data) } + ConfigManager.prototype.getShouldShowSeedWords = function () { var data = this.getData() return data.showSeedWords @@ -117,27 +118,6 @@ ConfigManager.prototype.getSeedWords = function () { var data = this.getData() return data.seedWords } - -/** - * Called to set the isRevealingSeedWords flag. This happens only when the user chooses to reveal - * the seed words and not during the first time flow. - * @param {boolean} reveal - Value to set the isRevealingSeedWords flag. - */ -ConfigManager.prototype.setIsRevealingSeedWords = function (reveal = false) { - const data = this.getData() - data.isRevealingSeedWords = reveal - this.setData(data) -} - -/** - * Returns the isRevealingSeedWords flag. - * @returns {boolean|undefined} - */ -ConfigManager.prototype.getIsRevealingSeedWords = function () { - const data = this.getData() - return data.isRevealingSeedWords -} - ConfigManager.prototype.setRpcTarget = function (rpcUrl) { var config = this.getConfig() config.provider = { -- cgit From 2a8d3ea450791c9c932bff4908aab3e62a1408f5 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 30 Apr 2018 12:07:48 -0700 Subject: sentry - wrap report modifiers in a try-catch --- app/scripts/lib/setupRaven.js | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/setupRaven.js b/app/scripts/lib/setupRaven.js index 48b941c3d..b69e08bae 100644 --- a/app/scripts/lib/setupRaven.js +++ b/app/scripts/lib/setupRaven.js @@ -23,23 +23,14 @@ function setupRaven(opts) { release, transport: function(opts) { const report = opts.data - // simplify certain complex error messages - if (report.exception && report.exception.values) { - report.exception.values.forEach(item => { - let errorMessage = item.value - // simplify ethjs error messages - errorMessage = extractEthjsErrorMessage(errorMessage) - // simplify 'Transaction Failed: known transaction' - if (errorMessage.indexOf('Transaction Failed: known transaction') === 0) { - // cut the hash from the error message - errorMessage = 'Transaction Failed: known transaction' - } - // finalize - item.value = errorMessage - }) + try { + // simplify certain complex error messages (e.g. Ethjs) + simplifyErrorMessages(report) + // modify report urls + rewriteReportUrls(report) + } catch (err) { + console.warn(err) } - // modify report urls - rewriteReportUrls(report) // make request normally client._makeRequest(opts) }, @@ -49,6 +40,23 @@ function setupRaven(opts) { return Raven } +function simplifyErrorMessages(report) { + if (report.exception && report.exception.values) { + report.exception.values.forEach(item => { + let errorMessage = item.value + // simplify ethjs error messages + errorMessage = extractEthjsErrorMessage(errorMessage) + // simplify 'Transaction Failed: known transaction' + if (errorMessage.indexOf('Transaction Failed: known transaction') === 0) { + // cut the hash from the error message + errorMessage = 'Transaction Failed: known transaction' + } + // finalize + item.value = errorMessage + }) + } +} + function rewriteReportUrls(report) { // update request url report.request.url = toMetamaskUrl(report.request.url) -- cgit From e881ea7aaf1faea8fdbf730c09a1aadbf2366d45 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 30 Apr 2018 12:10:15 -0700 Subject: sentry - report error-like messages using the obj message --- app/scripts/lib/setupRaven.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/setupRaven.js b/app/scripts/lib/setupRaven.js index b69e08bae..b1b67f771 100644 --- a/app/scripts/lib/setupRaven.js +++ b/app/scripts/lib/setupRaven.js @@ -24,6 +24,8 @@ function setupRaven(opts) { transport: function(opts) { const report = opts.data try { + // handle error-like non-error exceptions + nonErrorException(report) // simplify certain complex error messages (e.g. Ethjs) simplifyErrorMessages(report) // modify report urls @@ -40,6 +42,14 @@ function setupRaven(opts) { return Raven } +function nonErrorException(report) { + // handle errors that lost their error-ness in serialization + if (report.message.includes('Non-Error exception captured with keys: message')) { + if (!(report.extra && report.extra.__serialized__)) return + report.message = `Non-Error Exception: ${report.extra.__serialized__.message}` + } +} + function simplifyErrorMessages(report) { if (report.exception && report.exception.values) { report.exception.values.forEach(item => { -- cgit