doc / ch.tutteli.atrium.logic.creating.filesystem / java.nio.file.Path / runCatchingIo

runCatchingIo

inline fun <T> Path.runCatchingIo(block: Path.() -> T): IoResult<T>

Executes the given block and catches IOExceptions.

Exceptions

Exception - any exception that is thrown by block if it is not an IOException

Return
Success with this path and block’s result if block executes successfully. Failure with this path and the thrown IOException if block throws an IOException