Skip to content

Fail fast in generate-prefab-html.ts on non-ENOENT errors#245

Merged
kui merged 1 commit into
masterfrom
fix/fail-fast-non-enoent
Jul 12, 2026
Merged

Fail fast in generate-prefab-html.ts on non-ENOENT errors#245
kui merged 1 commit into
masterfrom
fix/fail-fast-non-enoent

Conversation

@kui

@kui kui commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Closes #230.

Changes

generate-prefab-html.ts

  • Replaced catch-all warn/return with throw for non-ENOENT errors.
  • Parser bugs and unexpected exceptions now fail the build instead of silently dropping the prefab.

prefab-html.ts

  • Changed SleeperVolumeFlags fallback from throw to flags[i] ?? 0, matching the 7DTD binary bounds-check in PrefabVolumes.PrefabSleeperVolumeList::ReadFromProperties.
  • Documented other optional property fallbacks with references to binary behaviour or vanilla data quirks.

prefab-html.test.ts

  • Added regression test for SleeperVolumeFlags short-array fallback.,

- Replace catch-all warn/return with rethrow so parser bugs and unknown
  data shapes fail the build instead of silently dropping prefabs.
- Align SleeperVolumeFlags fallback with the 7DTD binary bounds-check
  (Assembly-CSharp.dll, PrefabVolumes.PrefabSleeperVolumeList::ReadFromProperties):
  missing entries default to 0.
- Document other optional property fallbacks (vanilla omits trailing falses).
@kui
kui merged commit fa983a6 into master Jul 12, 2026
2 checks passed
@kui
kui deleted the fix/fail-fast-non-enoent branch July 12, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools/generate-prefab-html.ts swallows all non-ENOENT errors, hiding parser bugs

1 participant