[tests] Add x-vercel-id to test error message (#10149)

Including the `x-vercel-id` header when a e2e test fails will help us
debug issues
This commit is contained in:
Steven
2023-06-27 19:05:55 -04:00
committed by GitHub
parent 0867f11a6a
commit 733ff5ed85
5 changed files with 14 additions and 4 deletions

View File

@@ -44,7 +44,9 @@ function fetchWithRetry(url, opts = {}) {
if (res.status !== opts.status) {
const text = await res.text();
throw new Error(
`Failed to fetch ${url} with status ${res.status} (expected ${opts.status}):\n\n${text}\n\n`
`Failed to fetch "${url}", received ${res.status}, expected ${
opts.status
}, id: ${res.headers.get('x-vercel-id')}:\n\n${text}\n\n`
);
}

View File

@@ -32,7 +32,9 @@ function fetchTokenInformation(token: string, retries = 3) {
if (!res.ok) {
throw new Error(
`Failed to fetch ${url}, received status ${res.status}`
`Failed to fetch "${url}", status: ${
res.status
}, id: ${res.headers.get('x-vercel-id')}`
);
}

View File

@@ -43,7 +43,9 @@ function fetchTokenInformation(token: string, retries = 3) {
if (!res.ok) {
throw new Error(
`Failed to fetch ${url}, received status ${res.status}`
`Failed to fetch "${url}", status: ${
res.status
}, id: ${res.headers.get('x-vercel-id')}`
);
}

View File

@@ -47,7 +47,9 @@ function fetchTokenInformation(token: string, retries = 3) {
if (!res.ok) {
throw new Error(
`Failed to fetch ${url}, received status ${res.status}`
`Failed to fetch "${url}", status: ${
res.status
}, id: ${res.headers.get('x-vercel-id')}`
);
}