Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).catch(() => {
// ensure the session.user doesn't return the same rejected promise
// after a succussful login
this.session.notifyPropertyChange('user');
return RSVP.reject();
});
}
_resolveAuthedUser(msg) {
const user = this.get('_authenticatedUser');
if (user) {
return resolve(user);
} else {
return reject(msg);
}
},
beforeModel(transition) {
if (!this.auth.signedIn) {
this.set('auth.afterSignInTransition', transition);
return reject('needs-auth');
}
},
_handleCreditCardTokenError(response) {
return RSVP.reject(response);
},
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;
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;
}
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;
_handleCustomerCreationError() {
let friendlyError = new FriendlyError(CUSTOMER_CREATION_ERROR);
return RSVP.reject(friendlyError);
},
let onFailedSave = (reason) => {
part.deleteRecord();
return reject(reason);
};