diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/mvvm/ArchComponentExt.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/mvvm/ArchComponentExt.kt index e13bcf5ec65..cf28bf4c05c 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/mvvm/ArchComponentExt.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/mvvm/ArchComponentExt.kt @@ -76,20 +76,6 @@ fun logError(throwable: Throwable) { Log.d("ApiError", "-------------------------------------------------------------------") } -@Deprecated( - "Outdated function, use `safe` instead", - replaceWith = ReplaceWith("safe"), - level = DeprecationLevel.ERROR -) -fun normalSafeApiCall(apiCall: () -> T): T? { - return try { - apiCall.invoke() - } catch (throwable: Throwable) { - logError(throwable) - return null - } -} - /** Catches any exception (or error) and only logs it. * Will return null on exceptions. */ fun safe(apiCall: () -> T): T? { @@ -112,20 +98,6 @@ suspend fun safeAsync(apiCall: suspend () -> T): T? { } } -@Deprecated( - "Outdated function, use `safeAsync` instead", - replaceWith = ReplaceWith("safeAsync"), - level = DeprecationLevel.ERROR -) -suspend fun suspendSafeApiCall(apiCall: suspend () -> T): T? { - return try { - apiCall.invoke() - } catch (throwable: Throwable) { - logError(throwable) - return null - } -} - fun Throwable.getAllMessages(): String { return (this.localizedMessage ?: "") + (this.cause?.getAllMessages()?.let { "\n$it" } ?: "") }