mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-29 13:38:43 +00:00
0.20.2 - MessageToEditNotFoundException
This commit is contained in:
parent
ac915b79f7
commit
a68c31f9d1
@ -25,6 +25,7 @@
|
|||||||
### 0.20.2
|
### 0.20.2
|
||||||
|
|
||||||
* New exception type `MessageIsNotModifierException` was added
|
* New exception type `MessageIsNotModifierException` was added
|
||||||
|
* New exception type `MessageToEditNotFoundException` was added
|
||||||
* Now exceptions in requests will be caught correctly
|
* Now exceptions in requests will be caught correctly
|
||||||
|
|
||||||
## 0.19.0 ImplicitReflection removing
|
## 0.19.0 ImplicitReflection removing
|
||||||
|
@ -11,6 +11,7 @@ fun newRequestException(
|
|||||||
) = response.description ?.let { description ->
|
) = response.description ?.let { description ->
|
||||||
when {
|
when {
|
||||||
description == "Bad Request: reply message not found" -> ReplyMessageNotFoundException(response, plainAnswer, message, cause)
|
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.contains("Bad Request: message is not modified") -> MessageIsNotModifiedException(response, plainAnswer, message, cause)
|
||||||
description == "Unauthorized" -> UnauthorizedException(response, plainAnswer, message, cause)
|
description == "Unauthorized" -> UnauthorizedException(response, plainAnswer, message, cause)
|
||||||
else -> null
|
else -> null
|
||||||
@ -38,3 +39,6 @@ class ReplyMessageNotFoundException(response: Response, plainAnswer: String, mes
|
|||||||
|
|
||||||
class MessageIsNotModifiedException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) :
|
class MessageIsNotModifiedException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) :
|
||||||
RequestException(response, plainAnswer, message, cause)
|
RequestException(response, plainAnswer, message, cause)
|
||||||
|
|
||||||
|
class MessageToEditNotFoundException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) :
|
||||||
|
RequestException(response, plainAnswer, message, cause)
|
||||||
|
Loading…
Reference in New Issue
Block a user