toClientException

suspend fun Throwable.toClientException(failureCount: Int = 0): ClientException

provides a safe suspended casting of throwable converts any throwable into a ClientException. Clients don't need to perform casting as its handled on the SDK level.

Return

a ClientException object when casting success else it will return a ClientException with the throwable as a cause