Skip to content

Commit

Permalink
fix(deployCloudFormationStack): handle error from stack not existing yet
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Jan 24, 2019
1 parent fd021ee commit e09d9e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Deployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ export default class Deployer {
}

async hasStack(StackName) {
const result = await this._client.describeStacks({ StackName }).promise()
let result
try {
result = await this._client.describeStacks({ StackName }).promise()
} catch (error) {
if (/stack.+does not exist/i.test(error.message)) return false
}
if (result.Stacks.length !== 1) return false

// When you run CreateChangeSet on a a stack that does not exist,
Expand Down

0 comments on commit e09d9e4

Please sign in to comment.