Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ allprojects {
project build.gradle
```groovy
dependencies {
commonMainApi("dev.icerock.moko:errors:0.4.0")
commonMainApi("dev.icerock.moko:errors:0.5.0")
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,11 @@ object ExceptionMappersStorage {
inline fun <E : Throwable, reified T : Any> throwableMapper(): (e: E) -> T {
return throwableMapper(T::class)
}

/**
* Factory method that allows getting exception description
*/
inline fun <reified E : Throwable, reified T : Any> E.mapThrowable(): T {
return ExceptionMappersStorage.throwableMapper<E, T>(T::class)(this)
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ androidCoreTestingVersion = "2.1.0"
coroutinesVersion = "1.5.0-native-mt"
mokoMvvmVersion = "0.11.0"
mokoResourcesVersion = "0.16.0"
mokoErrorsVersion = "0.4.0"
mokoErrorsVersion = "0.5.0"

[libraries]
appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidAppCompatVersion" }
Expand Down