1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

InvalidPhotoDimensionsException

This commit is contained in:
InsanusMokrassar 2020-04-05 14:06:40 +06:00
parent 4e49de0dd7
commit 048aa93044
3 changed files with 7 additions and 1 deletions

View File

@ -48,6 +48,8 @@
* `StorageFile` now able to accept any factory of `Input`
* `StorageFileInfo` was added to avoid strange collisions with throws in `StorageFile`
* Fixes issue with `hashTag` for markdown
* `InvalidPhotoDimensionsException` was added for cases when `PHOTO_INVALID_DIMENSION` answer received
## 0.25.0
* Common:

View File

@ -14,6 +14,7 @@ fun newRequestException(
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)
description.contains("PHOTO_INVALID_DIMENSIONS") -> InvalidPhotoDimensionsException(response, plainAnswer, message, cause)
else -> null
}
} ?: CommonRequestException(response, plainAnswer, message, cause)
@ -41,3 +42,6 @@ class MessageIsNotModifiedException(response: Response, plainAnswer: String, mes
class MessageToEditNotFoundException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) :
RequestException(response, plainAnswer, message, cause)
class InvalidPhotoDimensionsException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) :
RequestException(response, plainAnswer, message, cause)

View File

@ -18,7 +18,7 @@ fun String.toMarkdown(): String {
private val markdownV2LinkEscapes = mutableSetOf(')', '\\')
private val markdownV2PreAndCodeEscapes = mutableSetOf('`', '\\')
private val markdownV2CommonEscapes = mutableSetOf(
private val markdownV2CommonEscapes = setOf(
'_',
'*',
'[', ']',