Skip to content

Commit 99a173e

Browse files
committed
bundle
1 parent 9209134 commit 99a173e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

dist/bundle.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ function pickChainUrl(chain) {
269269

270270
const MAIN_API_URL = 'https://api.etherscan.io';
271271
const TESTNET_API_URL_MAP = {
272-
ropsten: 'http://api-ropsten.etherscan.io',
273-
kovan: 'http://api-kovan.etherscan.io',
272+
ropsten: 'https://api-ropsten.etherscan.io',
273+
kovan: 'https://api-kovan.etherscan.io',
274274
rinkeby: 'https://api-rinkeby.etherscan.io',
275275
homestead: 'https://api.etherscan.io'
276276
};
@@ -295,8 +295,15 @@ module.exports = function(chain, timeout) {
295295
}
296296

297297
if (data.error) {
298-
return reject(new Error(data.error));
298+
var message = data.error;
299+
300+
if(typeof data.error === 'object' && data.error.message){
301+
message = data.error.message;
302+
}
303+
304+
return reject(new Error(message));
299305
}
306+
300307
resolve(data);
301308
}).catch(function(error) {
302309
return reject(new Error(error));

0 commit comments

Comments
 (0)