lib/client.js
function(filterIndex, options) {
      if (options === undefined) {
        throw new Error('Request filter at index ' + filterIndex + ' returned nothing; it must return the filtered request options');
      } else if (!_.isObject(options)) {
        throw new Error('Expected request filter at index ' + filterIndex + ' to return the request options as an object, got ' + typeof(options));
      }

      return options;
    }
function(filterIndex, options) {
      if (options === undefined) {
        throw new Error('Request filter at index ' + filterIndex + ' returned nothing; it must return the filtered request options');
      } else if (!_.isObject(options)) {
        throw new Error('Expected request filter at index ' + filterIndex + ' to return the request options as an object, got ' + typeof(options));
      }

      return options;
    }
function ( filterIndex , options ) { if ( options === undefined ) { throw new Error ( 'Request filter at index ' + filterIndex + ' returned nothing; it must return the filtered request options' ) ; } else if ( ! _ . isObject ( options ) ) { throw new Error ( 'Expected request filter at index ' + filterIndex + ' to return the request options as an object, got ' + typeof ( options ) ) ; } return options ; }
After each filter, this check ensures that the returned request options are valid. Again, any error is caught by the promise chain and causes the returned promise to be rejected.
After each filter this check ensures that the returned request options are valid . Again any error is caught by the promise chain and causes the returned promise to be rejected .