RajashekarRaju / compose-actors

:robot: Android app built with jetpack :rocket: compose follows new revamped guide to app architecture. Implemented with State, Coroutines :curly_loop:, ViewModels, Repository pattern, Light/Dark theme :rainbow: MD3, Animations, Draw on canvas, Custom layouts, UI state handling, :cyclone: Image loading with coil, Palette :art: usage and dynamic theming etc.
https://developersbreach.com/compose-android-app-architecture/
Apache License 2.0
269 stars 30 forks source link

Thrown exception during search #68

Closed alankley closed 1 year ago

alankley commented 1 year ago

Running in Emulator "Pixel 4 API 30". At a minimum I would think you would want to catch exception and recover

fun getResponseFromHttpUrl(
    url: URL
): String {
    val urlConnection: HttpURLConnection = url.openConnection() as HttpURLConnection
    return try {
        val stream: InputStream = urlConnection.inputStream // <-- Throws exception

FATAL EXCEPTION: main Process: com.developersbreach.composeactors, PID: 8081 java.io.FileNotFoundException: https://api.themoviedb.org/3/search/person?api_key=*Removed*&query=L at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:255) at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:211) at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:30) at com.developersbreach.composeactors.utils.NetworkQueryUtils.getResponseFromHttpUrl(NetworkQueryUtils.kt:26) at com.developersbreach.composeactors.data.datasource.network.NetworkDataSource$getSearchableActorsData$2.invokeSuspend(NetworkDataSource.kt:130) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@bd36bdf, Dispatchers.Main.immediate] 2023-06-08 15:28:29.415 8081-8081 Process com.developersbreach.composeactors I Sending signal. PID: 8081 SIG: 9

RajashekarRaju commented 1 year ago

Thanks for reporting. This pull request will fix the issue https://github.com/RajashekarRaju/compose-actors/pull/71