Repository navigation
refactor: replace generic exceptions with custom AsyncAPISchemaException in asyncapi util classes - #2066
Conversation
…aException in asyncapi util classes Introduce custom checked exception AsyncAPISchemaException to replace generic Exception throws flagged by SonarQube rule java:S112. - Add AsyncAPISchemaException with message and message+cause constructors - Update AsyncAPISchemaUtil: replace throws Exception in retrieveMessageAvroSchema, buildOneOfMessagesAvroSchemas and buildSingleMessageAvroSchema - Update AsyncAPISchemaValidator: replace throws Exception with AsyncAPISchemaException Signed-off-by: kishore08-07 <[email protected]>
|
Welcome to the Microcks community! 💖 Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly. Hope you have a great time there! |
lbroudoux
left a comment
There was a problem hiding this comment.
Looks all good to me. Thanks!
|
You are now a Microcks community contributor! 💖 Thanks and congrats 🚀 on merging your first pull request! We are delighted and very proud of you! 👏 📢 If you're using Microcks in your organization, please add your company name to this list. 🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact. If you need to know why and how to add yourself to the list, please read the blog post "Join the Microcks Adopters list and Empower the vibrant open source Community 🙌" Kudos and please keep going, we need you 🙌 |
Description
This PR addresses SonarQube maintainability violation "
java:S112: Generic exceptions should never be thrown" - inAsyncAPISchemaUtilandAsyncAPISchemaValidatorclasses undercommons/util/src/main/java/io/github/microcks/util/asyncapi.AsyncAPISchemaExceptionto replace all genericExceptionthrows across both classes.AsyncAPISchemaUtil: replace throws Exception inretrieveMessageAvroSchema,buildOneOfMessagesAvroSchemasandbuildSingleMessageAvroSchemaAsyncAPISchemaValidator: replace throws Exception withAsyncAPISchemaExceptionmvn spotless:check -pl commons/utilpasses locally.Related issue(s)
See also #2058