File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import * as fs from "fs"
66import * as YAML from "js-yaml"
77import * as jsonPointer from "json-pointer"
88import * as path from "path"
9-
109import * as util from "util"
1110import { log } from "./logging"
1211
@@ -148,14 +147,13 @@ export type Options = {
148147 */
149148export 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" ) {
You can’t perform that action at this time.
0 commit comments