From 09291414a6b40acc6197a9b99410990c1e349f7d Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 2 Feb 2023 14:15:05 +0100 Subject: [PATCH] fix: print deploy error_message, if exists (#5447) --- src/utils/deploy/util.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/deploy/util.mjs b/src/utils/deploy/util.mjs index 33c9f8b790c..28f99246bfd 100644 --- a/src/utils/deploy/util.mjs +++ b/src/utils/deploy/util.mjs @@ -23,7 +23,7 @@ export const waitForDiff = async (api, deployId, siteId, timeout) => { switch (siteDeploy.state) { // https://github.com/netlify/bitballoon/blob/master/app/models/deploy.rb#L21-L33 case 'error': { - const deployError = new Error(`Deploy ${deployId} had an error`) + const deployError = new Error(siteDeploy.error_message || `Deploy ${deployId} had an error`) deployError.deploy = siteDeploy throw deployError } @@ -60,7 +60,7 @@ export const waitForDeploy = async (api, deployId, siteId, timeout) => { switch (siteDeploy.state) { // https://github.com/netlify/bitballoon/blob/master/app/models/deploy.rb#L21-L33 case 'error': { - const deployError = new Error(`Deploy ${deployId} had an error`) + const deployError = new Error(siteDeploy.error_message || `Deploy ${deployId} had an error`) deployError.deploy = siteDeploy throw deployError }