Skip to content

Commit

Permalink
Catch and log errors not reported by steemd in the JS console
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Jun 5, 2017
1 parent 2671d52 commit 6ec5c9c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vessel",
"productName": "vessel",
"version": "0.0.6f",
"version": "0.0.6g",
"description": "A simple wallet for managing your Steem accounts.",
"main": "./main.prod.js",
"author": {
Expand Down
24 changes: 15 additions & 9 deletions app/reducers/processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,20 @@ export default function processing(state: any = defaultState, action: actionType
}

function setError(response) {
const stack = response.payload.error.data.stack[0];
const values = Object.keys(stack.data);
let message = stack.format;
if (values.length) {
values.map((key) => {
const value = stack.data[key];
message = message.split('${' + key + '}').join(value);
})
try {
const stack = response.payload.error.data.stack[0];
const values = Object.keys(stack.data);
let message = stack.format;
if (values.length) {
values.map((key) => {
const value = stack.data[key];
message = message.split('${' + key + '}').join(value);
});
}
return message;
} catch (e) {
console.log(e);
console.log(response);
return 'Unknown Error, check View -> Devtools for more information.';
}
return message
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vessel",
"productName": "vessel",
"version": "0.0.6f",
"version": "0.0.6g",
"description": "A simple wallet for managing your Steem accounts.",
"scripts": {
"test": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 node --trace-warnings ./test/runTests.js",
Expand Down

0 comments on commit 6ec5c9c

Please sign in to comment.