Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Catch error in command
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Gardner committed Mar 14, 2019
1 parent 3667365 commit 4561d22
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/commands/upload.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
const colors = require('colors/safe');
const constants = require('../constants');
const utils = require('../utils');

const upload = context => {
context.line('Preparing to upload a new version.\n');
return utils.upload().then(() => {
const upload = async context => {
try {
context.line('Preparing to upload a new version.\n');
await utils.upload();

context.line(
`\nUpload of ${constants.BUILD_PATH} and ${
constants.SOURCE_PATH
} complete! Try \`zapier versions\` now!`
);
});
} catch (error) {
context.line(`${colors.red('Problem uploading:')} ${error.message}`);
}
};
upload.argsSpec = [];
upload.argOptsSpec = {};
Expand Down

0 comments on commit 4561d22

Please sign in to comment.