diff --git a/packages/now-static-build/src/index.ts b/packages/now-static-build/src/index.ts index da18bced8..f335a9647 100644 --- a/packages/now-static-build/src/index.ts +++ b/packages/now-static-build/src/index.ts @@ -60,7 +60,7 @@ function validateDistDir(distDir: string) { if (!exists()) { throw new NowBuildError({ code: 'NOW_STATIC_BUILD_NO_OUT_DIR', - message: `No Output Directory named "${distDirName}" found after the Build completed.`, + message: `No Output Directory named "${distDirName}" found after the Build completed. You can configure the Output Directory in your project settings.`, link, }); } diff --git a/test/lib/deployment/now-deploy.js b/test/lib/deployment/now-deploy.js index 7a3e93769..a2d611e33 100644 --- a/test/lib/deployment/now-deploy.js +++ b/test/lib/deployment/now-deploy.js @@ -89,39 +89,54 @@ async function filePost (body, digest) { 'x-now-size': body.length, }; - const resp = await fetchWithAuth('/v2/now/files', { + const url = '/v2/now/files'; + + const resp = await fetchWithAuth(url, { method: 'POST', headers, body, }); + const json = await resp.json(); if (json.error) { - console.log('headers', resp.headers); - throw new Error(json.error.message); + const { status, statusText, headers } = resp; + const { message } = json.error; + console.log('Fetch Error', { url , status, statusText, headers, digest }); + throw new Error(message); } return json; } async function deploymentPost (payload) { - const resp = await fetchWithAuth('/v6/now/deployments?forceNew=1', { + const url = '/v6/now/deployments?forceNew=1'; + const resp = await fetchWithAuth(url, { method: 'POST', body: JSON.stringify(payload), }); - console.log(`fetch status: ${resp.status} ${resp.statusText}`); const json = await resp.json(); if (json.error) { - console.log('headers', resp.headers); - throw new Error(json.error.message); + const { status, statusText, headers } = resp; + const { message } = json.error; + console.log('Fetch Error', { url , status, statusText, headers }); + throw new Error(message); } return json; } async function deploymentGet (deploymentId) { - const resp = await fetchWithAuth(`/v3/now/deployments/${deploymentId}`); - return await resp.json(); + const url = `/v3/now/deployments/${deploymentId}`; + const resp = await fetchWithAuth(url); + const json = await resp.json(); + if (json.error) { + const { status, statusText, headers } = resp; + const { message } = json.error; + console.log('Fetch Error', { url , status, statusText, headers }); + throw new Error(message); + } + return json } let token;