From 321c10e50a5f6a7857dbf5e66874a0cd8945ed00 Mon Sep 17 00:00:00 2001 From: "Andrew A. Barber" Date: Tue, 17 Dec 2024 12:58:49 +0000 Subject: [PATCH 1/2] fix: STRF-XX - Improved upload error output --- lib/theme-api-client.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/theme-api-client.js b/lib/theme-api-client.js index 7dc0064a..a103a9e1 100644 --- a/lib/theme-api-client.js +++ b/lib/theme-api-client.js @@ -144,6 +144,11 @@ async function getJob({ accessToken, apiHost, storeHash, jobId, resultFilter }) const error = new Error('Job Failed'); error.name = 'JobCompletionStatusCheckError'; error.messages = (payload.data && payload.data.errors) || [{ message: payload.title }]; + //append a message to visit troubleshooting page, to help diagnose the issue. + if (error.messages) { + const visitTroubleshootingPage = `\nThe following page may help diagnose the issue: https://developer.bigcommerce.com/docs/storefront/stencil/deployment/upload-errors.`; + error.messages.push(visitTroubleshootingPage); + } throw error; } if (!payload.data || payload.data.status !== 'COMPLETED') { From 30d4f31fe5c309c85b406c638b1036fcef6cef91 Mon Sep 17 00:00:00 2001 From: "Andrew A. Barber" Date: Tue, 17 Dec 2024 13:01:27 +0000 Subject: [PATCH 2/2] fix: STRF-XX - Improved upload error output --- lib/theme-api-client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/theme-api-client.js b/lib/theme-api-client.js index a103a9e1..8da6dff9 100644 --- a/lib/theme-api-client.js +++ b/lib/theme-api-client.js @@ -147,7 +147,7 @@ async function getJob({ accessToken, apiHost, storeHash, jobId, resultFilter }) //append a message to visit troubleshooting page, to help diagnose the issue. if (error.messages) { const visitTroubleshootingPage = `\nThe following page may help diagnose the issue: https://developer.bigcommerce.com/docs/storefront/stencil/deployment/upload-errors.`; - error.messages.push(visitTroubleshootingPage); + error.messages.message += visitTroubleshootingPage; } throw error; }