Skip to content

Commit 3acf05c

Browse files
authored
Showing message if available
- Currently if getting empty array result of transaction, will throw an error with message 'NOTOK!' only and it is really hard to debug. Base on my investigate of response format I think we can use `message = resp.data.message` as error message.
1 parent 38bedfc commit 3acf05c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/get-request.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ module.exports = function(chain, timeout) {
3737
var data = response.data;
3838

3939
if (data.status && data.status != 1) {
40-
let returnMessage = 'NOTOK';
40+
let returnMessage = data.message ||'NOTOK';
4141
if (data.result && typeof data.result === 'string') {
4242
returnMessage = data.result;
4343
}
44+
4445
return reject(returnMessage);
4546
}
4647

0 commit comments

Comments
 (0)