File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,13 +150,15 @@ export async function makeRequest(options: Options) {
150150 const responseBody = await response . text ( )
151151
152152 if ( options . errorOnNon200Response && response . status !== 200 ) {
153- throw new Error ( `StatusCode: "${ response . status } ", ResponseBody: "${ responseBody } ."` )
153+ const msg = `StatusCode: "${ response . status } ", ResponseBody: "${ responseBody } ."`
154+ throw new Error ( msg )
154155 }
155156
156157 try {
157158 return parseContent ( options . url , responseBody )
158159 } catch ( error ) {
159- throw new Error ( `An error occurred while parsing the file ${ options . url } . The error is:\n ${ util . inspect ( error , { depth : null } ) } .` )
160+ const msg = `An error occurred while parsing the file ${ options . url } . The error is:\n ${ util . inspect ( error , { depth : null } ) } .`
161+ throw new Error ( msg )
160162 }
161163}
162164
You can’t perform that action at this time.
0 commit comments