wrapIOException

@JvmName(name = "wrapIO")
inline fun Throwable.wrapIOException(): IOException(source)

Ensures that the throwable is an instance of IOException. If it is not, it will encase it in one. If the throwable is an instance of InterruptedException, this function returns an InterruptedIOException with the InterruptedException as a suppressed exception.


@JvmName(name = "wrapIO")
inline fun Throwable.wrapIOException(lazyMessage: () -> String): IOException(source)

Ensures that the throwable is an instance of IOException. If it is not, it will encase it in one with the provided lazyMessage. If the throwable is an instance of InterruptedException, this function returns an InterruptedIOException with the InterruptedException as a suppressed exception.