Skip to content

Commit

Permalink
Merge pull request #305 from hotwired/remote-path-config-exceptions
Browse files Browse the repository at this point in the history
Catch all exceptions when attempting to fetch the remote config and log errors
  • Loading branch information
jayohms authored Feb 23, 2024
2 parents c548547 + f568c23 commit 95de8a7
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 95de8a7

Please sign in to comment.