Skip to content

Commit

Permalink
test/e2e/api: include response status text in errors if no response b…
Browse files Browse the repository at this point in the history
…ody (#1354)
  • Loading branch information
alxndrsn authored Jan 13, 2025
1 parent 7e30f2d commit ec1c0ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/util/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async function apiClient(suiteName, { serverUrl, userEmail, userPassword, logPat
if(isRedirected(res)) return new Redirect(res);
if(!res.ok) {
const responseStatus = res.status;
const responseText = await res.text();
const responseText = await res.text() || res.statusText;

const err = new Error(`${responseStatus}: ${responseText}`);
err.responseStatus = responseStatus;
Expand Down

0 comments on commit ec1c0ae

Please sign in to comment.