1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

0.20.2 - MessageToEditNotFoundException

This commit is contained in:
InsanusMokrassar 2019-12-13 23:55:06 +06:00
parent ac915b79f7
commit a68c31f9d1
2 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,7 @@
### 0.20.2
* New exception type `MessageIsNotModifierException` was added
* New exception type `MessageToEditNotFoundException` was added
* Now exceptions in requests will be caught correctly
## 0.19.0 ImplicitReflection removing

View File

@ -11,6 +11,7 @@ fun newRequestException(
) = response.description ?.let { description ->
when {
description == "Bad Request: reply message not found" -> ReplyMessageNotFoundException(response, plainAnswer, message, cause)
description == "Bad Request: message to edit not found" -> MessageToEditNotFoundException(response, plainAnswer, message, cause)
description.contains("Bad Request: message is not modified") -> MessageIsNotModifiedException(response, plainAnswer, message, cause)
description == "Unauthorized" -> UnauthorizedException(response, plainAnswer, message, cause)
else -> null
@ -38,3 +39,6 @@ class ReplyMessageNotFoundException(response: Response, plainAnswer: String, mes
class MessageIsNotModifiedException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) :
RequestException(response, plainAnswer, message, cause)
class MessageToEditNotFoundException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) :
RequestException(response, plainAnswer, message, cause)