How to use the rsvp.reject function in rsvp

To help you get started, we’ve selected a few rsvp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TryGhost / Ghost-Admin / app / session-stores / application.js View on Github external
}).catch(() => {
            // ensure the session.user doesn't return the same rejected promise
            // after a succussful login
            this.session.notifyPropertyChange('user');
            return RSVP.reject();
        });
    }
github paulcwatts / ember-cognito / addon-test-support / utils / -mock-auth.js View on Github external
_resolveAuthedUser(msg) {
    const user = this.get('_authenticatedUser');
    if (user) {
      return resolve(user);
    } else {
      return reject(msg);
    }
  },
github travis-ci / travis-web / app / routes / github-apps-installation.js View on Github external
beforeModel(transition) {
    if (!this.auth.signedIn) {
      this.set('auth.afterSignInTransition', transition);
      return reject('needs-auth');
    }
  },
github code-corps / code-corps-ember / app / controllers / project / checkout.js View on Github external
_handleCreditCardTokenError(response) {
    return RSVP.reject(response);
  },
github johanneswuerbach / ember-cli-sauce / lib / commands / sauce-connect.js View on Github external
run: function() {
    if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
      var msg = "Can't find the username or access key for SauceLabs. Please set the 'SAUCE_USERNAME' and 'SAUCE_ACCESS_KEY' environment variable.";
      return RSVP.reject(new Error(msg));
    }

    var self = this;
    var opts = {
      username: process.env.SAUCE_USERNAME,
      accessKey: process.env.SAUCE_ACCESS_KEY,
      verbose: true,
      logger: function(message) {
        self.ui.writeLine(message, 'INFO');
      },
      pidfile: path.join(this.project.root, 'sc_client.pid'),
      connectRetries: 2
    };

    if (process.env.SAUCE_VERSION) {
      opts.connectVersion = process.env.SAUCE_VERSION;
github tildeio / router.js / dist / router.cjs.js View on Github external
function Transition(router, intent, state, error) {
  var transition = this;
  this.state = state || router.state;
  this.intent = intent;
  this.router = router;
  this.data = this.intent && this.intent.data || {};
  this.resolvedModels = {};
  this.params = {};

  if (intent && intent.inaccessibleByURL) {
    this.urlMethod = null;
  }

  if (error) {
    this.promise = RSVP.reject(error);
    return;
  }

  if (state) {
    var len = state.handlerInfos.length;
    if (len) {
      this.targetName = state.handlerInfos[state.handlerInfos.length-1].name;
    }

    for (var i = 0; i < len; ++i) {
      var handlerInfo = state.handlerInfos[i];
      if (!(handlerInfo instanceof ResolvedHandlerInfo)) {
        break;
      }
      this.pivotHandler = handlerInfo.handler;
    }
github ember-cli-deploy / ember-cli-deploy-revision-data / lib / data-generators / version-commit.js View on Github external
generate: function() {
    var separator = this._plugin.readConfig('separator');
    var versionFile = this._plugin.readConfig('versionFile');

    var info = gitRepoInfo();

    if (info === null || info.root === null) {
      return RSVP.reject('Could not find git repository');
    }

    var sha = (info.sha || '').slice(0, 8);
    var plugin = this._plugin;

    return readFile(versionFile)
      .then(function(contents) {
        var json = JSON.parse(contents);

        if (!json.version) {
          return RSVP.reject('Could not build revision with version `' + json.version + '` and commit hash `' + sha + '`');
        }

        var versionString = json.version;
        if (sha) {
          versionString = versionString + separator + sha;
github code-corps / code-corps-ember / app / controllers / project / checkout.js View on Github external
_handleCustomerCreationError() {
    let friendlyError = new FriendlyError(CUSTOMER_CREATION_ERROR);
    return RSVP.reject(friendlyError);
  },
github code-corps / code-corps-ember / app / controllers / conversations / conversation.js View on Github external
let onFailedSave = (reason) => {
      part.deleteRecord();
      return reject(reason);
    };