Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/kes.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ class Kes {
const destPath = path.join(this.config.kesFolder, this.cf_template_name);
console.log(`Template saved to ${destPath}`);
return fs.writeFileSync(destPath, cf);
}).catch((e) => {
console.log(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would also want to re-throw the error here or else it would be swallowed when compileCF is called elsewhere, like uploadCF

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I added a throw

});
}

Expand Down
8 changes: 7 additions & 1 deletion src/lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@ class Lambda {
s3.headObject({
Bucket: this.bucket,
Key: lambda.remote
}).promise().then((data) => {
}).promise().catch(
(e) => {
console.log('Error uploading lambda to: ' + params.Bucket + '/' + params.Key);

throw e;
}
).then((data) => {
if (data.ContentLength !== params.Body.byteLength) {
throw new Error('File sizes don\'t match');
}
Expand Down