Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return d.promise.error(function(e){
if ( e === 'ERROR_REQUEST' && retry.count < retry.maxTry ) {
verbose && console.log('retry previous request');
return D.wait(Math.min(1 << retry.count, retry.maxDelay)).then(function(){
retry.count++;
params.retry = retry;
impersonation && (params.impersonate = impersonation);
return self.request(method, path, params);
});
}
verbose && console.log('ERROR', e);//, req);
throw e;
});
}