fix(registry): use adapter-neutral server errors - #1547
Merged
ricardo-devis-agullo merged 2 commits intoAug 9, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the registry’s emitted error event code to be adapter-neutral, so server-adapter failures no longer leak transport-specific details (Express) into registry event consumers, while keeping the existing error event payload shape and lifecycle behavior intact.
Changes:
- Replace legacy
EXPRESS_ERRORwith adapter-neutralSERVER_ERRORfor server adapter failures. - Export and document the stable
RegistryErrorEvent{ code, message }payload type. - Update unit + TypeScript type tests and migration documentation to reflect the new error code.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| V1.md | Marks the adapter-neutral error code migration item (R17) as completed and updates rollout notes. |
| packages/oc/test/unit/registry.js | Updates expected emitted error code and adds coverage around server adapter error emission behavior. |
| packages/oc/test/types/registry-events.ts | Adds a TS type-level check that registry.on('error', ...) receives RegistryErrorEvent. |
| packages/oc/src/types.ts | Introduces exported RegistryErrorEvent type with documented { code, message } shape. |
| packages/oc/src/registry/index.ts | Emits SERVER_ERROR for adapter onServerError and preserves error message + rejection behavior. |
| packages/oc/src/registry/domain/events-handler.ts | Types the error event payload as RegistryErrorEvent. |
| packages/oc/src/index.ts | Re-exports RegistryErrorEvent from the package public API. |
| packages/oc/README.md | Documents registry error event payload and the adapter-neutral SERVER_ERROR code. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+348
to
+352
| describe('when the configured HTTP server adapter emits an error', () => { | ||
| for (const adapterName of ['express', 'fastify', 'future']) { | ||
| it(`should emit the same error event for ${adapterName}`, async () => { | ||
| deps['./domain/plugins-initialiser'].init.resolves('ok'); | ||
| repositoryInitStub.resolves('ok'); |
Contributor
There was a problem hiding this comment.
Collapsed the loop into a single test that asserts SERVER_ERROR is emitted for adapter errors. Commit: Collapse misleading parametrized adapter test to a single test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
No changeset or version bump included, per repository contribution guidance.