Skip to content
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
wants to merge 24 commits into from
Closed

Exceptions #657

wants to merge 24 commits into from

Conversation

karb0f0s
Copy link
Member

@karb0f0s karb0f0s commented Mar 28, 2018

Refactor ApiExceptionParser.Parse

  • 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
  • add optional parameters to InvalidParameterException derived classes
  • fix tests to handle BadRequestException
  • separate collections for different exception types

Clean ApiException class

  • remove commented out exception code

Bring back exceptions

  • exception BotBlockedException
  • exception BotRestrictedException
  • exception MissingParameterException
  • exception NotEnoughRightsException
  • exception WrongChatTypeException
  • add test case for MissingParameterException
  • add test cases for WrongChatTypeException
  • fix Should_Throw_On_Setting_Chat_Sticker_Set test to handle WrongChatTypeException

Changed

  • arrange exception classes in folders according to their base classes

Added

  • exception ChatDescriptionIsNotModifiedException
  • exception ChatNotModifiedException
  • exception SendMessageToBotException
  • exception TooManyRequestsException
  • exception BotIsNotMemberException

#646 #628 #648

- `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 karb0f0s removed the wip label Apr 6, 2018
@poulad
Copy link
Member

poulad commented Apr 30, 2018

@karb0f0s is there any breaking change? If not, we will release new exceptions later.

@karb0f0s karb0f0s closed this May 25, 2018
@karb0f0s karb0f0s deleted the exceptions branch August 8, 2018 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants