: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.
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
Running in Emulator "Pixel 4 API 30". At a minimum I would think you would want to catch exception and recover
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