mirror of
https://github.com/stoatchat/python-client-sdk.git
synced 2026-07-21 10:05:22 -04:00
[PR #67] [CLOSED] Raise proper exceptions when converters fail #85
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/stoatchat/python-client-sdk/pull/67
Author: @Solarphlare
Created: 8/8/2023
Status: ❌ Closed
Base:
master← Head:master📝 Commits (1)
c85d7f1Raise proper exceptions when converters fail📊 Changes
1 file changed (+8 additions, -0 deletions)
View changed files
📝
revolt/ext/commands/converters.py(+8 -0)📄 Description
When the converters such as MemberConverter, ChannelConverter and UserConverter are unable to locate their respective item, they raise LookupErrors instead of the errors that are supposed to be raised when they fail—such as ChannelConverterError and MemberConverterError, for example. Since LookupError is raised for all of these converters when they can't find an item, it makes it difficult to distinguish between things like member lookup errors and channel lookup errors in
on_command_error().This PR rectifies the issue by catching any
LookupErrors raised by the converters and instead raising the proper errors.Please make sure to check the following tasks before opening and submitting a PR
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.