Skip to content

Commit bb4d547

Browse files
committed
Throw early when mod download response has a status >=400
1 parent 69314b5 commit bb4d547

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
# Change Log
44

55
## [Unreleased]
6+
7+
8+
## Fixed
9+
10+
- Throw failed to fetch error instead of digest mismatch error when mod download response has a status code >=400
11+
612
## [1.1.0] 2025-08-17
713

814
### Added

src/mod-installer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ export class ModInstaller {
391391
const resp = await fetch(installation.url).catch(_ => {
392392
throw new Error(Lang.errors.install.failedFetch)
393393
})
394+
if (resp.status >= 400) {
395+
throw new Error(Lang.errors.install.failedFetch)
396+
}
394397

395398
const { arrayBuffer, progressFunc } = this.downloadWithProgress(resp)
396399

0 commit comments

Comments
 (0)