Skip to content

Fix no-argument exceptions across all message event handlers - #72

Merged
Sharkwald merged 1 commit into
mainfrom
bugfix/no-argument-handler-exceptions
Apr 21, 2026
Merged

Fix no-argument exceptions across all message event handlers#72
Sharkwald merged 1 commit into
mainfrom
bugfix/no-argument-handler-exceptions

Conversation

@Sharkwald

Copy link
Copy Markdown
Owner
  • GetCurrentKarmaReasonsHandler: fix slice to use TrimEnd().Length so
    '_reasons' (no trailing space) no longer throws; TrimStart() the result
    before splitting so '_reasons alice' still works correctly
  • SearchHandler, WikipediaHandler, UrbanHandler, GiphyHandler,
    ImageSearchHandler: same slice fix plus an explicit empty-arg guard
    that sends a user-friendly 'Please provide a...' message instead of
    silently swallowing an ArgumentOutOfRangeException
  • Tests: promote GetCurrentKarmaReasonsHandler no-recipient test to
    [Theory] covering both '_reasons' and '_reasons '; add equivalent
    [Theory] no-argument tests to all five mandatory-argument handler
    test classes

- GetCurrentKarmaReasonsHandler: fix slice to use TrimEnd().Length so
  '_reasons' (no trailing space) no longer throws; TrimStart() the result
  before splitting so '_reasons alice' still works correctly
- SearchHandler, WikipediaHandler, UrbanHandler, GiphyHandler,
  ImageSearchHandler: same slice fix plus an explicit empty-arg guard
  that sends a user-friendly 'Please provide a...' message instead of
  silently swallowing an ArgumentOutOfRangeException
- Tests: promote GetCurrentKarmaReasonsHandler no-recipient test to
  [Theory] covering both '_reasons' and '_reasons '; add equivalent
  [Theory] no-argument tests to all five mandatory-argument handler
  test classes
@Sharkwald
Sharkwald merged commit fe1b0a3 into main Apr 21, 2026
2 checks passed
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.

1 participant