Add structured unknown error from telegram api#736
Open
Add structured unknown error from telegram api#736
Conversation
Collaborator
|
Hey @ev-gusev, good catch. I think we can change |
Author
I actually thought about it, but I thought that there might be library users who used regular expressions and parsed these errors that were not of type Error to accomplish the goals I was pursuing . So I didn't risk it |
Author
|
@demget What do you think about it? |
Collaborator
|
@ev-gusev we will include this in the breaking V4 release |
Author
I got you, changed the default case |
Author
|
@demget Is something wrong? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are cases when api telegram returns errors that do not have static text, for example:
In this case, it is impossible to determine on the library user side that this error is a Bad Request, as it will be generic and will only contain the error text
This PR solves this problem and allows to handle such errors as follows:
Errors that were previously predefined as bad request will be handled in the same form