We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f63fd8c commit 3bf230eCopy full SHA for 3bf230e
src/core/services/HttpClient.ts
@@ -96,12 +96,14 @@ export class HttpClient {
96
// No Content
97
json = {};
98
} else {
99
+ // Read text first to avoid body-already-consumed errors when JSON parsing fails
100
+ const text = await response.text();
101
try {
- json = await response.json();
102
+ json = JSON.parse(text);
103
} catch {
104
json = {
105
error: 'invalid_json',
- error_description: await response.text(),
106
+ error_description: text,
107
};
108
}
109
0 commit comments