code: function withTimeout_p(timeoutMs, promise, label) {
    label = label || 'Operation';
    var defer = Q.defer();
    promise.then(
      function(value) {
        defer.resolve(value);
      },
      function(err) {
        defer.reject(err);
      }
    );
    setTimeout(function() {
      var err = new Error(label + ' timed out');
      err.code = 'ETIMEOUT';
      defer.reject(err);
    }, timeoutMs);
    return defer.promise;
  }
docs: If timeoutMs elapses before promise resolves, the returned promise will
  fail with an Error whose code is 'ETIMEOUT'. Otherwise the returned promise
  passes through the resolution/failure of the original promise.