File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -269,8 +269,8 @@ function pickChainUrl(chain) {
269
269
270
270
const MAIN_API_URL = 'https://api.etherscan.io' ;
271
271
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' ,
274
274
rinkeby : 'https://api-rinkeby.etherscan.io' ,
275
275
homestead : 'https://api.etherscan.io'
276
276
} ;
@@ -295,8 +295,15 @@ module.exports = function(chain, timeout) {
295
295
}
296
296
297
297
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 ) ) ;
299
305
}
306
+
300
307
resolve ( data ) ;
301
308
} ) . catch ( function ( error ) {
302
309
return reject ( new Error ( error ) ) ;
You can’t perform that action at this time.
0 commit comments