Skip to content

Commit f1c121f

Browse files
committed
minimize diff
1 parent c3cee86 commit f1c121f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/lib/util/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)