Throw on a missing file when loadJsonObject is asked to

Controller.loadJsonObject(path, true) returned {} for a missing file, so
loadPlugins' catch never ran and a plugin whose web build was expected but
missing was not reported (the second half of #1046; #1047 fixed the path).
With throwOnMissing set, every error now throws; without it only a missing
file is ignored, so a malformed JSON file throws again as before #1047.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BGUULoiHNbAegwMK4PSjHJ
This commit is contained in:
ILLISISandClaude Opus 5.5 committed 2026-10-07 01:21:11 +11:00
1 parent d89a6e33f3
commit b2a426bb30
3 files changed
+33 -1

No files matched your search

+1 -1
View File
@@ -842,7 +842,7 @@ export default class Controller {
try {
manifest = JSON.parse(await fs.readFile(filePath, { encoding: "utf8" }));
} catch (err: any) {
if (throwOnMissing && err.code !== "ENOENT") {
if (throwOnMissing || err.code !== "ENOENT") {
throw err;
}
}