Skip to content

Commit

Permalink
Api response (#134)
Browse files Browse the repository at this point in the history
* change api response message format

* update version
  • Loading branch information
xzjcool authored May 21, 2019
1 parent 7aec925 commit a347b71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@binance-chain/javascript-sdk",
"version": "2.13.0",
"version": "2.13.1",
"license": "Apache-2.0",
"main": "lib/index.js",
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ class HttpRequest {
console.error("error in HttpRequest#request", err, err.statusCode)
let error = err
try {
const msgObj = err.response && err.response.data && JSON.parse(err.response.data.message)
const msgObj = err.response && err.response.data
error = new Error(msgObj.message)
error.code = msgObj.code
error.abci_code = msgObj.abci_code
} catch (err) {
throw error
}
Expand Down

0 comments on commit a347b71

Please sign in to comment.