fix(installer): 다운로드 HTTP 오류에 실패한 URL 표시 (v0.4.28)

fetchBuffer/downloadStream 이 4xx/5xx 에 "HTTP 404" 처럼 상태코드만 던져,
어떤 파일(mods/resourcepack/map/config/server)이 없는지 알 수 없었다.
에러 메시지에 실패 URL 을 붙여 config 미업로드 등 원인을 바로 식별 가능하게 함.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-08-11 00:08:59 +09:00
parent bed47e88a0
commit 7508f3b11b
2 changed files with 3 additions and 3 deletions

View File

@@ -152,7 +152,7 @@ function fetchBuffer(url: string, redirects = 0, attempt = 0): Promise<Buffer> {
}
if (code >= 400) {
response.resume()
reject(new Error(`HTTP ${code}`))
reject(new Error(`HTTP ${code}: ${url}`))
return
}
const chunks: Buffer[] = []
@@ -627,7 +627,7 @@ function downloadStream(
res.resume()
fileStream.close(() => {
signal.removeEventListener('abort', onAbort)
if (!settled) { settled = true; reject(new Error(`HTTP ${sc}`)) }
if (!settled) { settled = true; reject(new Error(`HTTP ${sc}: ${url}`)) }
})
return
}