-
-
Notifications
You must be signed in to change notification settings - Fork 359
feat: add validation and descriptive errors to QueryParamsVariables #1785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add validation and descriptive errors to QueryParamsVariables #1785
Conversation
implemented proper validation and descriptive error messages in one component (`QueryParamsVariables`) to demonstrate the proposed error-handling pattern. Previously, unsupported `language` or `framework` values would cause deep runtime failures.
|
What reviewer looks at during PR reviewThe following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.
|
WalkthroughThis PR enhances the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
@Jatin24062005 You’ve added error handling in a single component, but the issue is more widespread than that. This isn’t really a beginner-level problem. If you still want to work on it, I’d recommend first researching in detail how we can implement a DRY approach—perhaps by centralizing error handling through shared helpers or a common abstraction. Given the current state, I’m closing this PR for now. |
|
@Adi-204 Thanks for reviewing this. I think I can really work on this, and it’s not that tough from a research perspective, as you mentioned. Could you please share any reference documentation related to this so I can move forward? Alternatively, you could provide a brief blueprint or high-level overview of how I should proceed. My approach isn’t wrong, but I think it’s not very efficient right now because a single component is being used in the file. If you could help guide me on how to move forward, I’d really appreciate it. Also, this is a demo PR, as I mentioned earlier in the issue comments. |



Description
This PR introduces the first step toward a consistent error-handling pattern inside
@asyncapi/generator-components.Implemented proper validation and clear error messages in the
QueryParamsVariablescomponent.Previously, unsupported
languageorframeworkvalues resulted in deep runtime failures or confusing stack traces.With this update, the component now fails early with descriptive and actionable errors, improving the developer experience for template authors.
This PR serves as a demonstration of the proposed error-handling approach that can be extended to the rest of the components.
Issue-: #1712
Related issue(s)
See also: Issue: #1712
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.