-
-
Notifications
You must be signed in to change notification settings - Fork 690
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exceptions #657
Closed
Closed
Exceptions #657
Conversation
This file contains 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
- `BadRequestException` is thrown on `Error 400: Bad request` if more specific exception is not defined - `ForbiddenException` is thrown on `Error 403: Forbidden` if more specific exception is not defined - Fix tests to handle `BadRequestException`
- Exception `BotBlockedException` - Exception `BotRestrictedException` - Exception `MissingParameterException` - Exception `NotEnoughRightsException` - Exception `WrongChatTypeException` - Cleanup ApiException - Add parameters to InvalidParameterException derived classes in ApiExceptionParser - Add exception test cases
- fixed BadRequestException not thrown if typeInfo?.Type is null
- ChatDescriptionIsNotModifiedException is thrown when chat description is not modified - Add ChatDescriptionIsNotModifiedException test case
- ChatNotModifiedException is thrown when the chat parameters is not modified during request - add ChatNotModifiedException test cases
- arrange exception classes in folders according to their base classes - add annotations to disable ReSharper CheckNamespace warning
- add ForibddenExceptionInfos array for ForbiddenException derived classes - add BadRequestExceptionInfos array for BadRequestException derived classes
- SendMessageToBotException is thrown when the bot sends message to another bot - add SendMessageToBotException test case
- TooManyRequestsException is thrown when the bot reaches message send limit - add TooManyRequestsException test case
- throw TooManyRequestsException with apiResponse.Parameters - add delay in Should_Throw_Exception_TooManyRequestsException to avoid failure in next test
- BotIsNotMemberExceptionis thrown when bot sends message to the supergroup or channel in which it was not added - Add BotIsNotMemberExceptiontest case
@karb0f0s is there any breaking change? If not, we will release new exceptions later. |
This was referenced May 7, 2018
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.
Refactor
ApiExceptionParser.Parse
BadRequestException
is thrown onError 400: Bad request
if more specific exception is not definedForbiddenException
is thrown onError 403: Forbidden
if more specific exception is not definedInvalidParameterException
derived classesBadRequestException
Clean
ApiException
classBring back exceptions
BotBlockedException
BotRestrictedException
MissingParameterException
NotEnoughRightsException
WrongChatTypeException
MissingParameterException
WrongChatTypeException
Should_Throw_On_Setting_Chat_Sticker_Set
test to handleWrongChatTypeException
Changed
Added
ChatDescriptionIsNotModifiedException
ChatNotModifiedException
SendMessageToBotException
TooManyRequestsException
BotIsNotMemberException
#646 #628 #648