function resolveNext(err, creds) {
	        if ((!err && creds) || index === providers.length) {
	          AWS.util.arrayEach(self.resolveCallbacks, function (callback) {
	            callback(err, creds);
	          });
	          self.resolveCallbacks.length = 0;
	          return;
	        }

	        var provider = providers[index++];
	        if (typeof provider === 'function') {
	          creds = provider.call();
	        } else {
	          creds = provider;
	        }

	        if (creds.get) {
	          creds.get(function (getErr) {
	            resolveNext(getErr, getErr ? null : creds);
	          });
	        } else {
	          resolveNext(null, creds);
	        }
	      }
Resolves the provider chain by searching for the first set of
credentials in {providers}.

@callback callback function(err, credentials)
  Called when the provider resolves the chain to a credentials object
  or null if no credentials can be found.

  @param err [Error] the error object returned if no credentials are
    found.
  @param credentials [AWS.Credentials] the credentials object resolved
    by the provider chain.
@return [AWS.CredentialProviderChain] the provider, for chaining.