mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-25 03:28:44 +00:00
commit
3f13e5d062
11
CHANGELOG.md
11
CHANGELOG.md
@ -42,6 +42,17 @@
|
||||
* `HttpClient#loadFile`
|
||||
* `PathedFile#download`
|
||||
|
||||
### 0.28.1
|
||||
|
||||
* Common:
|
||||
* Versions updates:
|
||||
* `Kotlin`: `1.4.0` -> `1.4.10`
|
||||
* `UUID`: `0.2.1` -> `0.2.2`
|
||||
* `TelegramBotAPI-core`:
|
||||
* `ExceptionHandler` has changed its incoming type: `Exception` -> `Throwable`
|
||||
* `handleSafely` has changed its signature
|
||||
* `executeUnsafe` has changed its signature
|
||||
|
||||
## 0.27.0
|
||||
|
||||
* `Common`:
|
||||
|
@ -4,7 +4,7 @@ import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.supervisorScope
|
||||
|
||||
|
||||
typealias ExceptionHandler<T> = suspend (Exception) -> T
|
||||
typealias ExceptionHandler<T> = suspend (Throwable) -> T
|
||||
/**
|
||||
* It will run [block] inside of [supervisorScope] to avoid problems with catching of exceptions
|
||||
*
|
||||
@ -17,7 +17,7 @@ suspend inline fun <T> handleSafely(
|
||||
): T {
|
||||
return try {
|
||||
supervisorScope(block)
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
onException(e)
|
||||
}
|
||||
}
|
||||
|
@ -24,10 +24,10 @@ suspend fun <T: Any> RequestsExecutor.executeUnsafe(
|
||||
request: Request<T>,
|
||||
retries: Int = 0,
|
||||
retriesDelay: Long = 1000L,
|
||||
onAllFailed: (suspend (exceptions: Array<Exception>) -> Unit)? = null
|
||||
onAllFailed: (suspend (exceptions: Array<Throwable>) -> Unit)? = null
|
||||
): T? {
|
||||
var leftRetries = retries
|
||||
val exceptions = onAllFailed ?.let { mutableListOf<Exception>() }
|
||||
val exceptions = onAllFailed ?.let { mutableListOf<Throwable>() }
|
||||
do {
|
||||
return handleSafely(
|
||||
{
|
||||
|
@ -5,16 +5,16 @@ kotlin.js.generate.externals=true
|
||||
kotlin.incremental=true
|
||||
kotlin.incremental.js=true
|
||||
|
||||
kotlin_version=1.4.0
|
||||
kotlin_version=1.4.10
|
||||
kotlin_coroutines_version=1.3.9
|
||||
kotlin_serialisation_runtime_version=1.0.0-RC
|
||||
klock_version=1.12.0
|
||||
uuid_version=0.2.1
|
||||
uuid_version=0.2.2
|
||||
ktor_version=1.4.0
|
||||
|
||||
javax_activation_version=1.1.1
|
||||
|
||||
library_group=com.github.insanusmokrassar
|
||||
library_version=0.28.0
|
||||
library_version=0.28.1
|
||||
|
||||
gradle_bintray_plugin_version=1.8.5
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
|
||||
|
Loading…
Reference in New Issue
Block a user