refactor: migrate error handling from name to type parameter with semantic error types#106
Merged
M-jerez merged 4 commits intomion-run-typesfrom Aug 26, 2025
Merged
Conversation
…d only use the type
…ers after making RpcError type not default
This was referenced Aug 26, 2025
Closed
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.
🔄 Error Handling Refactoring
This PR completes the migration from the old
nameparameter to the newtypeparameter in RpcError instances across the codebase, implementing semantic, kebab-case error types for improved type safety and consistency.✅ Changes Completed
Core Error System Updates
RpcErrorandTypedErrorclasses to use onlytypepropertynamepropertyisRpcErrorandisTypedErrortype guardsRpcError Instantiation Fixes
typeparameterinternal-server-error- Generic internal server errorsroute-not-found- 404 not found errorsparameter-validation-error- Parameter validation failuresparameter-deserialization-error- Parameter deserialization failuresinvalid-request-body-type- Invalid request body typesrequest-body-parsing-error- JSON parsing errorsresponse-body-stringify-error- Response serialization errorsremote-methods-metadata-error- Metadata retrieval errorsunknown-execution-error- Generic execution errorsTest Updates
nameproperty expectations from PublicRpcError objects'unknown'to specific semantic typesFiles Modified
packages/core/src/errors.ts- Updated error classes and type guardspackages/router/src/errors.ts- Added semantic error typespackages/router/src/notFound.ts- Added route-not-found error typepackages/router/src/dispatch.ts- Added parameter validation error typespackages/router/src/jsonBodyParser.routes.ts- Added body parsing error typespackages/router/src/client.routes.ts- Added metadata error type🧪 Test Results
🎯 Benefits
typeproperty🔍 Notes
Pull Request opened by Augment Code with guidance from the PR author
Resolves #96