Fixed requested changes

This commit is contained in:
Andres Aguilar
2020-08-22 19:37:20 -07:00
committed by GitHub
parent becaf839aa
commit 33b3094f12
@@ -12,6 +12,7 @@ import org.jellyfin.mobile.utils.Constants.SERVER_INFO_PATH
import org.json.JSONException
import org.json.JSONObject
import timber.log.Timber
import java.io.IOException
suspend fun WebappActivity.checkServerUrlAndConnection(enteredUrl: String): HttpUrl? {
val normalizedUrl = enteredUrl.run {
@@ -72,6 +73,7 @@ suspend fun fetchServerInfo(httpClient: OkHttpClient, url: HttpUrl): String? {
try {
request.execute().use { it.body?.string() }
} catch (e: IOException) {
Timber.e(e, "Cannot connect to server")
null
}
}