From 4b65b428ac75b54f43f45599d757b9d3d68e17fd Mon Sep 17 00:00:00 2001 From: Patrick Edqvist Date: Tue, 2 Jun 2020 11:31:05 +0200 Subject: [PATCH] console log errors from waitForStatus --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 4e34df8d..4c98616b 100644 --- a/index.js +++ b/index.js @@ -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)); } }