Skip to content

fix(core): preserve original error cause chain in getModule#165

Merged
karelhala merged 1 commit intomainfrom
fix/preserve-original-error-in-getModule
May 5, 2026
Merged

fix(core): preserve original error cause chain in getModule#165
karelhala merged 1 commit intomainfrom
fix/preserve-original-error-in-getModule

Conversation

@Hyperkid123
Copy link
Copy Markdown
Member

Summary

  • Removes the try/catch in getModule that was swallowing the original ErrorWithCause from @openshift/dynamic-plugin-sdk and replacing it with a generic "Module not initialized!" message
  • Adds explicit scope validation in both getModule and preloadModule — when a scope isn't in the scalprum config, the error now lists all available scopes
  • Adds a distinct error when the scope exists but lacks a manifestLocation

Resolves RHCLOUD-47479

Test plan

  • Existing unit tests pass
  • Verify that federated module loading failures now surface the original error cause chain
  • Verify that loading a module with an unknown scope shows available scopes in the error

🤖 Generated with Claude Code

@Hyperkid123 Hyperkid123 requested a review from a team as a code owner May 5, 2026 10:31
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 5, 2026

View your CI Pipeline Execution ↗ for commit eb9af3b

Command Status Duration Result
nx run test-app:serve ✅ Succeeded 1m 47s View ↗
nx run-many -t build ✅ Succeeded 1s View ↗
nx affected -t component-test --configuration=ci ✅ Succeeded <1s View ↗
nx affected -t lint ✅ Succeeded 2s View ↗
nx affected -t test --configuration=ci ✅ Succeeded <1s View ↗
nx affected -t build ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-05 11:06:49 UTC

The catch block in getModule was swallowing the original ErrorWithCause
from the dynamic-plugin-sdk and replacing it with a generic message,
making it impossible to diagnose federated module loading failures.

Also improves error messages when a scope is missing from the scalprum
config by listing available scopes.

Resolves: RHCLOUD-47479

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Hyperkid123 Hyperkid123 force-pushed the fix/preserve-original-error-in-getModule branch from 1d5acd1 to eb9af3b Compare May 5, 2026 10:57
@karelhala karelhala merged commit ef11bbc into main May 5, 2026
8 checks passed
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.

2 participants