hotfix: fix reject error message in rpc api

This commit is contained in:
George Lima 2018-12-21 12:43:40 -03:00
parent 5d0060194b
commit 2c71bcbbdc
1 changed files with 4 additions and 1 deletions

View File

@ -32,7 +32,10 @@ const api: APIMethods = METHODS.reduce(
params: args,
},
})
.then(data => Promise.resolve(data.body && data.body.result)),
.then(data => Promise.resolve(data.body && data.body.result))
.catch(payload => Promise.reject(
new Error(payload.body?.error.message || 'Something went wrong'),
)),
}),
{},
);