Skip to content

Commit f94254b

Browse files
committed
Merge branch 'copilot/fix-360' of https://github.com/Azure/openapi-diff into copilot/fix-360
2 parents 4aa8b45 + dc053f6 commit f94254b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/lib/util/utils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as fs from "fs"
66
import * as YAML from "js-yaml"
77
import * as jsonPointer from "json-pointer"
88
import * as path from "path"
9-
109
import * as util from "util"
1110
import { log } from "./logging"
1211

@@ -148,14 +147,13 @@ export type Options = {
148147
*/
149148
export async function makeRequest(options: Options) {
150149
const response = await fetch(options.url)
150+
const responseBody = await response.text()
151151

152152
if (options.errorOnNon200Response && response.status !== 200) {
153-
const responseBody = await response.text()
154153
const msg = `StatusCode: "${response.status}", ResponseBody: "${responseBody}."`
155154
throw new Error(msg)
156155
}
157156

158-
const responseBody = await response.text()
159157
let res = responseBody
160158
try {
161159
if (typeof responseBody.valueOf() === "string") {

0 commit comments

Comments
 (0)