code: function () {
        var self = this;
        return function () {
          var status = self.statusCode;
          
          if (status === 0 || (status >= 400 && status < 600)) {
            return context.asRejectedPromise(self);
          }
          
          return context.asPromise(self);
        };
      }
docs: Custom function to return when a mock is present