diff --git a/CHANGELOG.md b/CHANGELOG.md index 71e09f1..e5715fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ This list is not intended to be all-encompassing - it will document major and breaking API changes with their rationale when appropriate: +### v2.16.0.0 +- **result4k** : [Breaking change] Changed bounds in `resultFromCatching` from `Throwable` to `Exception`. + ### v2.15.1.0 - **data4k** : Rename methods for consistency. Old methods have been deprecated. diff --git a/result4k/core/src/main/kotlin/dev/forkhandles/result4k/result.kt b/result4k/core/src/main/kotlin/dev/forkhandles/result4k/result.kt index a357ef5..068e148 100644 --- a/result4k/core/src/main/kotlin/dev/forkhandles/result4k/result.kt +++ b/result4k/core/src/main/kotlin/dev/forkhandles/result4k/result.kt @@ -23,7 +23,7 @@ inline fun resultFrom(block: () -> T): Result = /** * Call a block and catch a specific Throwable type, returning it as an `Err` value. */ -inline fun resultFromCatching(block: () -> T): Result = resultFrom(block).mapFailure { +inline fun resultFromCatching(block: () -> T): Result = resultFrom(block).mapFailure { when (it) { is E -> it else -> throw it