Skip to content

Conversation

@Askeban
Copy link
Contributor

@Askeban Askeban commented Aug 20, 2025

This commit addresses an issue where the CompareItemsHandler would crash
with a KeyError if one or both of the items to be compared were not
found.

The fix involves the following changes:

  • Modified the do method in CompareItemsHandler to use .get() for
    safer dictionary access, preventing the KeyError.
  • Updated the _send_no_items_found_message method to send a more
    informative message, indicating which of the items were found.
  • Corrected a typo in a log message within the do method's exception
    handler.
  • Added a new test file test_compare_items.py with unit tests to
    cover scenarios where one or both items are not found.

These changes ensure that the system gracefully handles cases where
items are not found and provides better feedback to the user.

google-labs-jules bot and others added 2 commits August 20, 2025 09:58
This commit addresses an issue where the CompareItemsHandler would crash
with a KeyError if one or both of the items to be compared were not
found.

The fix involves the following changes:
- Modified the `do` method in `CompareItemsHandler` to use `.get()` for
  safer dictionary access, preventing the `KeyError`.
- Updated the `_send_no_items_found_message` method to send a more
  informative message, indicating which of the items were found.
- Corrected a typo in a log message within the `do` method's exception
  handler.
- Added a new test file `test_compare_items.py` with unit tests to
  cover scenarios where one or both items are not found.

These changes ensure that the system gracefully handles cases where
items are not found and provides better feedback to the user.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.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.

1 participant