Skip to content

Commit c91f9d1

Browse files
frostebiteclaude
andcommitted
fix: only suppress module-not-found errors in plugin loader
Previously both loadOrchestrator() and loadPluginServices() caught all errors, masking real failures like syntax errors or missing transitive dependencies. Now only MODULE_NOT_FOUND / ERR_MODULE_NOT_FOUND errors are suppressed; all other exceptions are rethrown. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 25f0a9c commit c91f9d1

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

dist/index.js

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/model/orchestrator-plugin.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ export async function loadOrchestrator(): Promise<
3030
};
3131
},
3232
};
33-
} catch {
34-
// Orchestrator package not installed
33+
} catch (error) {
34+
if (!isModuleNotFoundError(error)) {
35+
throw error;
36+
}
3537
}
3638
}
3739

@@ -76,6 +78,20 @@ export async function loadPluginServices() {
7678
},
7779
};
7880
} catch (error) {
81+
if (!isModuleNotFoundError(error)) {
82+
throw error;
83+
}
7984
core.warning(`Orchestrator plugin not available: ${(error as Error).message}`);
8085
}
8186
}
87+
88+
function isModuleNotFoundError(error: unknown): boolean {
89+
if (error && typeof error === 'object' && 'code' in error) {
90+
const code = (error as { code: string }).code;
91+
if (code === 'MODULE_NOT_FOUND' || code === 'ERR_MODULE_NOT_FOUND') {
92+
return true;
93+
}
94+
}
95+
96+
return typeof (error as Error)?.message === 'string' && /cannot find module/i.test((error as Error).message);
97+
}

0 commit comments

Comments
 (0)