Skip to content

Commit

Permalink
Throw error on non OK
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesa2 committed Nov 29, 2023
1 parent e566f17 commit b84e694
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import kotlinx.coroutines.withContext
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Response
import timber.log.Timber
import java.lang.RuntimeException
import java.net.HttpURLConnection
import java.util.concurrent.TimeUnit


Expand Down Expand Up @@ -77,6 +79,8 @@ object AppUpdateHelper {
callback?.invoke("Nothing to do with ${release.tagName}")
}
}
if (versionList.code() != HttpURLConnection.HTTP_OK)
throw RuntimeException("call delivers ${versionList.code()}")
} catch (e: Exception) {
Timber.e("git check deliver: ${e.message}")
Toast.makeText(activity, "git check delivers: ${e.message}", Toast.LENGTH_LONG).show()
Expand All @@ -103,6 +107,8 @@ object AppUpdateHelper {
Notify.notification(appContext, text, "New version for '${getAppName(appContext)}'", assetApk, release)
}
}
if (versionList.code() != HttpURLConnection.HTTP_OK)
throw RuntimeException("call delivers ${versionList.code()}")
} catch (e: Exception) {
Timber.e("git check deliver: ${e.message}")
}
Expand Down

0 comments on commit b84e694

Please sign in to comment.