catchAsHttpError

inline fun <R, T : R, E : Throwable> KrosstalkResult<T>.catchAsHttpError(klass: KClass<E>, statusCode: Int, message: (E) -> String? = { it.message }): KrosstalkResult<R>

Catch an exception by type. Must be called where the exception/KrosstalkResult is created, type information is lost during serialization.

Sources

Link copied to clipboard