Skip to content

Conversation

@jayychoi
Copy link

This PR improves error reporting for optional options that are misconfigured.

  • Fail fast for optional options without default value: CommandFactoryBean now validates that optional options must have a default value. If an optional option is declared without a default value, the application fails at startup with a clear error message instead of logging a warning at runtime.

  • Option without value already handled: This is already handled by DefaultCommandParser since commit 78d1a47, which throws an IllegalArgumentException when parsing such input.

Changes

  • CommandFactoryBean: Added validation to reject optional options without default values at command registration time
  • CommandFactoryBeanTests: Added unit tests for the new validation logic

Resolves #1245

Resolves spring-projects#1245

Signed-off-by: Jay Choi <jayyoungchoi22@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error reporting when non mandatory options are misconfigured or incorrectly specified at runtime

1 participant