We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 029e157 commit dc053f6Copy full SHA for dc053f6
src/lib/util/utils.ts
@@ -147,14 +147,13 @@ export type Options = {
147
*/
148
export async function makeRequest(options: Options) {
149
const response = await fetch(options.url)
150
+ const responseBody = await response.text()
151
152
if (options.errorOnNon200Response && response.status !== 200) {
- const responseBody = await response.text()
153
const msg = `StatusCode: "${response.status}", ResponseBody: "${responseBody}."`
154
throw new Error(msg)
155
}
156
157
158
let res = responseBody
159
try {
160
if (typeof responseBody.valueOf() === "string") {
0 commit comments