Skip to content

Commit 5756ebd

Browse files
fix: include content-type in error message for non-JSON responses in fetchExternal
1 parent 93463a9 commit 5756ebd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/App/src/utils/httpClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class HttpClient {
7070
}
7171
const contentType = response.headers.get('content-type') || '';
7272
if (!contentType.toLowerCase().includes('application/json')) {
73-
throw new Error(`${config.method || 'GET'} ${url} returned non-JSON response`);
73+
throw new Error(`${config.method || 'GET'} ${url} returned non-JSON response (content-type: ${contentType || 'unknown'})`);
7474
}
7575
return response.json();
7676
}

0 commit comments

Comments
 (0)