diff --git a/CHANGELOG.md b/CHANGELOG.md index a2d4fbd9a5..7544196c29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * [\#1500](https://github.com/cosmos/voyager/issues/1500) Fixed wrong optimistic updates to the atom balance after staking @faboweb @fedekunze * [\#1517](https://github.com/cosmos/voyager/issues/1517) Fixed wrong account format used for querying selfBond @faboweb * [\#1503](https://github.com/cosmos/voyager/issues/1503) Added e2e test for balance updates after delegation @faboweb +* [\#1131](https://github.com/cosmos/voyager/issues/1131) Display only error message on notifications @fedekunze * [\#1440](https://github.com/cosmos/voyager/issues/1440) Fixed an error that prevented disconnecting from the RPC websocket if it wasn't defined @fedekunze ## [0.10.7] - 2018-10-10 diff --git a/app/src/main/index.js b/app/src/main/index.js index 1358ab337b..1ee3df5dbc 100644 --- a/app/src/main/index.js +++ b/app/src/main/index.js @@ -82,14 +82,14 @@ function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)) } -function handleCrash(error) { +function handleCrash(err) { afterBooted(() => { if (mainWindow) { mainWindow.webContents.send(`error`, { - message: error - ? error.message - ? error.message - : error + message: err + ? err.message + ? err.message + : err : `An unspecified error occurred` }) } @@ -315,7 +315,7 @@ function stopLCD() { lcdProcess.kill(`SIGKILL`) } catch (err) { handleCrash(err) - reject(`Stopping the LCD resulted in an error: ` + err.message) + reject(`Stopping the LCD resulted in an error: ${err.message}`) } }) } diff --git a/app/src/renderer/components/wallet/PageSend.vue b/app/src/renderer/components/wallet/PageSend.vue index df3fc5ccb6..172ead2e22 100644 --- a/app/src/renderer/components/wallet/PageSend.vue +++ b/app/src/renderer/components/wallet/PageSend.vue @@ -168,8 +168,8 @@ export default { } catch (err) { this.sending = false this.$store.commit(`notifyError`, { - title: `Error Sending`, - body: `An error occurred while trying to send: "${err.message}"` + title: `Error Sending transaction`, + body: err.message }) } }, @@ -181,8 +181,8 @@ export default { b32.decode(param) this.bech32error = null return true - } catch (error) { - this.bech32error = error.message + } catch (err) { + this.bech32error = err.message return false } }, diff --git a/app/src/renderer/main.js b/app/src/renderer/main.js index ab2247311d..cd9ccfe784 100644 --- a/app/src/renderer/main.js +++ b/app/src/renderer/main.js @@ -85,14 +85,14 @@ async function main() { next() }) - ipcRenderer.on(`error`, (event, error) => { - switch (error.code) { + ipcRenderer.on(`error`, (event, err) => { + switch (err.code) { case `NO_NODES_AVAILABLE`: store.commit(`setModalNoNodes`, true) break default: store.commit(`setModalError`, true) - store.commit(`setModalErrorMessage`, error.message) + store.commit(`setModalErrorMessage`, err.message) } }) ipcRenderer.on(`approve-hash`, (event, hash) => { diff --git a/app/src/renderer/vuex/modules/blockchain.js b/app/src/renderer/vuex/modules/blockchain.js index 30b51033f8..ec1c9de013 100644 --- a/app/src/renderer/vuex/modules/blockchain.js +++ b/app/src/renderer/vuex/modules/blockchain.js @@ -72,9 +72,7 @@ export default ({ node }) => { function error(err) { dispatch(`nodeHasHalted`) - console.error( - `Error subscribing to new blocks: ${err.message} ${err.data || ``}` - ) + console.error(err.message) } node.rpc.status((err, status) => { diff --git a/app/src/renderer/vuex/modules/send.js b/app/src/renderer/vuex/modules/send.js index 5ee72080ca..a1cb130deb 100644 --- a/app/src/renderer/vuex/modules/send.js +++ b/app/src/renderer/vuex/modules/send.js @@ -86,13 +86,13 @@ export default ({ node }) => { function assertOk(res) { if (Array.isArray(res)) { - if (res.length === 0) throw new Error(`Error sending transaction.`) + if (res.length === 0) throw new Error(`Error sending transaction`) return res.forEach(assertOk) } if (res.check_tx.code || res.deliver_tx.code) { let message = res.check_tx.log || res.deliver_tx.log - throw new Error(`Error sending transaction: ` + message) + throw new Error(message) } } diff --git a/archive/components/NiVotes.vue b/archive/components/NiVotes.vue index 1e86e4174a..cbf3385a0a 100644 --- a/archive/components/NiVotes.vue +++ b/archive/components/NiVotes.vue @@ -39,10 +39,10 @@ export default { rootId: this.parent.rootId, // for comments userUid: this.user.uid }) - .then(null, error => { + .then(null, err => { this.$store.commit("notifyError", { title: "Updating vote failed", - body: error.message + body: err.message }) }) } diff --git a/test/unit/specs/components/wallet/PageSend.spec.js b/test/unit/specs/components/wallet/PageSend.spec.js index f745e11ccd..ad2c750e6b 100644 --- a/test/unit/specs/components/wallet/PageSend.spec.js +++ b/test/unit/specs/components/wallet/PageSend.spec.js @@ -219,7 +219,7 @@ describe(`PageSend`, () => { node.sign = () => Promise.reject() await wrapper.vm.onApproved() expect(store.state.notifications.length).toBe(1) - expect(store.state.notifications[0].title).toBe(`Error Sending`) + expect(store.state.notifications[0].title).toBe(`Error Sending transaction`) expect(store.state.notifications[0]).toMatchSnapshot() }) diff --git a/test/unit/specs/components/wallet/__snapshots__/PageSend.spec.js.snap b/test/unit/specs/components/wallet/__snapshots__/PageSend.spec.js.snap index de2ba04e4a..bfcb818b26 100644 --- a/test/unit/specs/components/wallet/__snapshots__/PageSend.spec.js.snap +++ b/test/unit/specs/components/wallet/__snapshots__/PageSend.spec.js.snap @@ -2056,11 +2056,11 @@ exports[`PageSend should show bech32 error when alphanumeric is wrong 1`] = ` exports[`PageSend should show notification for unsuccessful send 1`] = ` Object { - "body": "An error occurred while trying to send: \\"Error sending transaction: Not enough coins in your account\\"", + "body": "Not enough coins in your account", "icon": "error", "layout": "alert", "time": 42000, - "title": "Error Sending", + "title": "Error Sending transaction", "type": "error", } `;