Skip to content

Commit

Permalink
Catch all exceptions when attempting to fetch the remote config and l…
Browse files Browse the repository at this point in the history
…og errors
  • Loading branch information
jayohms committed Feb 23, 2024
1 parent c548547 commit f568c23
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.SharedPreferences
import androidx.core.content.edit
import dev.hotwire.turbo.http.TurboHttpClient
import dev.hotwire.turbo.util.dispatcherProvider
import dev.hotwire.turbo.util.logError
import dev.hotwire.turbo.util.toJson
import kotlinx.coroutines.withContext
import okhttp3.Request
Expand Down Expand Up @@ -43,10 +44,15 @@ internal class TurboPathConfigurationRepository {
if (response.isSuccessful) {
response.body?.string()
} else {
logError(
"remotePathConfigurationFailure",
Exception("location: ${request.url}, status code: ${response.code}")
)
null
}
}
} catch (e: IOException) {
} catch (e: Exception) {
logError("remotePathConfigurationException", e)
null
}
}
Expand Down

0 comments on commit f568c23

Please sign in to comment.