soap-stub.js
function createErroringStub(err) {
  return function() {
    this.args.forEach(function(argSet) {
      setTimeout(argSet[1].bind(null, err));
    });
    this.yields(err);
  };
}
function createErroringStub(err) {
  return function() {
    this.args.forEach(function(argSet) {
      setTimeout(argSet[1].bind(null, err));
    });
    this.yields(err);
  };
}
function createErroringStub ( err ) { return function ( ) { this . args . forEach ( function ( argSet ) { setTimeout ( argSet [ 1 ] . bind ( null , err ) ) ; } ) ; this . yields ( err ) ; } ; }
Returns a method that calls all callbacks given to the method it is attached
to with the given error.

<pre>
myClientStub.someMethod.errorOnCall = createErroringStub(error);

// elsewhere

myClientStub.someMethod.errorOnCall();
</pre>

@param {?} object anything
@return {Function}
Returns a method that calls all callbacks given to the method it is attached to with the given error .