Skip to content
Snippets Groups Projects
Commit d3b78432 authored by Tom Robinson's avatar Tom Robinson
Browse files

Potential fix for _location CI failures

parent 395f8a61
No related branches found
No related tags found
No related merge requests found
......@@ -668,6 +668,14 @@ api._makeRequest = async (method, url, headers, requestBody, data, options) => {
? { status: 0, responseText: "" }
: await fetch(api.basename + url, fetchOptions);
if (!window.document) {
console.warn(
"API request completed after test ended. Ignoring result.",
url,
);
return;
}
if (isCancelled) {
throw { status: 0, data: "", isCancelled: true };
}
......@@ -710,6 +718,16 @@ api._makeRequest = async (method, url, headers, requestBody, data, options) => {
throw error;
}
} catch (e) {
if (!window.document) {
console.warn(
"API request failed after test ended. Ignoring result.",
url,
e,
);
return;
}
throw e;
} finally {
pendingRequests--;
if (pendingRequests === 0 && pendingRequestsDeferred) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment