bito-code-review[bot] commented on PR #15970:
URL: https://github.com/apache/grails-core/pull/15970#issuecomment-4946213754
<!-- Bito Reply -->
Changing the warning to an exception is appropriate if duplicate plugin
registration is considered a critical configuration error that should prevent
application startup. In the current implementation, the code logs a warning and
returns, allowing the application to continue with the first registered
version. If you decide to throw an exception, you should replace the
`LOG.warn(...)` call with a `throw new IllegalStateException(...)` or a similar
exception type to halt execution.
**grails-core/src/main/groovy/org/apache/grails/core/plugins/DefaultPluginDiscovery.java**
```
if (registeredPlugin != null) {
throw new IllegalStateException(
"Grails plug-in [" + plugin.getName() + "] with version
[" +
registeredPlugin.getPluginVersion() + "] is already
registered; " +
"cannot register duplicate declaration with version [" +
plugin.getPluginVersion() + "]"
);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]