File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -148,19 +148,18 @@ export type Options = {
148148export async function makeRequest ( options : Options ) {
149149 const response = await fetch ( options . url )
150150 const responseBody = await response . text ( )
151-
151+
152152 if ( options . errorOnNon200Response && response . status !== 200 ) {
153153 throw new Error ( `StatusCode: "${ response . status } ", ResponseBody: "${ responseBody } ."` )
154154 }
155-
155+
156156 let res = responseBody
157157 try {
158158 if ( typeof responseBody . valueOf ( ) === "string" ) {
159159 res = parseContent ( options . url , responseBody )
160160 }
161161 } catch ( error ) {
162- const msg = `An error occurred while parsing the file ${ options . url } . The error is:\n ${ util . inspect ( error , { depth : null } ) } .`
163- throw new Error ( msg )
162+ throw new Error ( `An error occurred while parsing the file ${ options . url } . The error is:\n ${ util . inspect ( error , { depth : null } ) } .` )
164163 }
165164
166165 return res
You can’t perform that action at this time.
0 commit comments