Skip to content
This repository was archived by the owner on Dec 26, 2024. It is now read-only.

Commit f7bcf7b

Browse files
committed
fix error handling edge case
1 parent 1e86840 commit f7bcf7b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/init.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ module.exports = function (apiKey, chain) {
5151
return reject(data.message);
5252
}
5353

54+
if (data.error) {
55+
return reject(data.error.message);
56+
}
57+
5458
resolve(data);
5559
});
5660
});
@@ -202,7 +206,7 @@ module.exports = function (apiKey, chain) {
202206
const module = 'proxy';
203207
const action = 'eth_getTransactionByHash';
204208
var query = querystring.stringify({
205-
module, action, apiKey, hash
209+
module, action, apiKey, txhash
206210
});
207211
return getRequest(query);
208212
},

0 commit comments

Comments
 (0)