Skip to content

Commit 1292baa

Browse files
committed
fix: body used already error fix #340
1 parent 03a67e7 commit 1292baa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/httpadapter/fetchadapter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ class FetchAdapter {
4242
if (fullResponse) {
4343
return res;
4444
}
45+
const rawResponseBody = res.text();
4546
try {
46-
return await res.json();
47+
return JSON.parse(rawResponseBody);
4748
} catch (e) {
48-
throw new HttpError(await res.text(), {
49+
throw new HttpError(rawResponseBody, {
4950
code: res.statusCode
5051
});
5152
}

0 commit comments

Comments
 (0)