New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding enum variant to handle unknown 400 #902
base: master
Are you sure you want to change the base?
adding enum variant to handle unknown 400 #902
Conversation
Did you check if you can still get |
I did not, but I can. I just assumed it was a full match on the entire string because serde should visit the entire string but weird things have happened. This error mentioned in the issue did not cause the inverse to happen accidentally logging it as the known MessageCantBeDeleted because of the string similarities but I dont know if that case would be true. |
@stillbeingnick your assumption is correct, I just want to make sure that the other (old) error actually exists, that Telegram can return it. |
Ill put together a test over the weekend and confirm it still works and update here if that is good with you @WaffleLapkin |
@WaffleLapkin it seems like your hunch might have been correct. Based on my testing I cannot get telegram to return the previous "Message can't be deleted" error message. The only case I have not tested thus far is a message being over 48 hours old. Both group message delete errors and the errors you get trying to delete dice messages that are less than 24 hours old in private chats responds with the "Message can't be deleted for everyone" error message. I have a commit staged that removes the other variant and leaves only the new MessageCantBeDeletedForEveryone variant. However I wanted to get your thoughts on cleaning this up since this would break code that matches on that ApiError variant. |
@WaffleLapkin, what's the status of this PR? |
Ooops, sorry, I forgot to reply here. @stillbeingnick IMO we should keep the same variant name and only fix the matching logic, the error message changed but the meaning stayed I think. |
(@stillbeingnick this is marked as
S-waiting-on-author
|
Change Description
Created new ApiError enum variant to handle previously unhanded 400 error from Telegram. This was highlighted in issue #901. A new test case was added so the variant would be included in the "custom_result" test for the ApiError enum.
Doc Notes
The Doc Comment that was added to the variant tries to sum up the use case the error might occur however there is no official guidance on why this would occur so please change/add if we think of a better example of why this error might occur.
Tests ran and passed after change but please let me know if there are any other considerations 馃憤