Skip to content

Error when returning an empty ammount #193

Open
@jabrPromtior

Description

@jabrPromtior

The CompareItemsHandler Class doesnt have "_send_no_items_found_message" method implemented, so when your query doesnt match anything, it throws this error and retries, getting stuck in a loop:

Image
Implementing the function similar to whats in "ItemDetailsHandler" was the patch i made but im sure this is not the correct way of fixing it:

    async def _send_no_items_found_message(self):
        message = {
            "message_type": "compare_items",
            "details": f"Could not find one or both items ('{self.item1_name}', '{self.item2_name}') on {self.handler.site}.",
            "item1": {
                "name": self.item1_name,
                "found": bool(self.found_items.get(self.item1_name)),
            },
            "item2": {
                "name": self.item2_name,
                "found": bool(self.found_items.get(self.item2_name)),
            },
            "site": self.handler.site
        }
        await self.handler.send_message(message)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions