Skip to content

Commit 9f11455

Browse files
committed
Better error when there are bad responses
1 parent 1791d15 commit 9f11455

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/webapp/app/utils/longPollingFetch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export async function longPollingFetch(url: string, options?: RequestInit) {
1212

1313
// Check if the response is ok (status in the range 200-299)
1414
if (!response.ok) {
15-
throw new Error(`HTTP error! status: ${response.status}`);
15+
const body = await response.text();
16+
throw new Error(`HTTP error! status: ${response.status}. ${body}`);
1617
}
1718

1819
if (response.headers.get(`content-encoding`)) {

0 commit comments

Comments
 (0)