mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
make sure to follow the serverless framework conventions for error handling
This commit is contained in:
parent
a76ae91488
commit
8fbcf71da7
@ -158,22 +158,25 @@ class Platform {
|
||||
const readmePath = path.join(this.serverless.config.servicePath, 'README.md');
|
||||
const serviceDataWithReadme = addReadme(serviceData, readmePath);
|
||||
|
||||
return this.publishServiceRequest(serviceDataWithReadme, clientWithAuth)
|
||||
.then(() => {
|
||||
const username = jwtDecode(authToken).nickname;
|
||||
const serviceName = this.serverless.service.service;
|
||||
const url = `${config.PLATFORM_FRONTEND_BASE_URL}services/${username}/${serviceName}`;
|
||||
this.serverless
|
||||
.cli.log('Service successfully published! Your service details are available at:');
|
||||
this.serverless
|
||||
.cli.log(chalk.green(url));
|
||||
})
|
||||
.catch(error => {
|
||||
this.serverless.cli.log(
|
||||
"Couldn't publish this deploy information to the Serverless Platform due: \n",
|
||||
error
|
||||
);
|
||||
});
|
||||
return new BbPromise((resolve, reject) => {
|
||||
this.publishServiceRequest(serviceDataWithReadme, clientWithAuth)
|
||||
.then(() => {
|
||||
const username = jwtDecode(authToken).nickname;
|
||||
const serviceName = this.serverless.service.service;
|
||||
const url = `${config.PLATFORM_FRONTEND_BASE_URL}services/${username}/${serviceName}`;
|
||||
this.serverless.cli.log(
|
||||
'Service successfully published! Your service details are available at:'
|
||||
);
|
||||
this.serverless.cli.log(chalk.green(url));
|
||||
resolve();
|
||||
})
|
||||
.catch(error => {
|
||||
this.serverless.cli.log(
|
||||
"Couldn't publish this deploy information to the Serverless Platform."
|
||||
);
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user