Skip to content

Commit

Permalink
console log errors from waitForStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickedqvist committed Jun 2, 2020
1 parent e9c31ca commit 4b65b42
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@ const waitForStatus = async ({ token, owner, repo, deployment_id }, MAX_TIMEOUT)
const status = statuses.data.length > 0 && statuses.data[0];

if ( !status ) {
throw Error()
throw Error('No status was available')
} else if ( status && status.state !== 'success')
throw Error()
throw Error('No status with state "success" was available')
if (status && status.state === 'success' ) {
return status
} else {
throw Error()
throw Error('Unknown status error')
}

} catch (e) {
console.log("Deployment unavailable or not successful, retrying...");
console.log(e)
await new Promise(r => setTimeout(r, 2000));
}
}
Expand Down

0 comments on commit 4b65b42

Please sign in to comment.