Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thrown exception during search #68

Closed
alankley opened this issue Jun 8, 2023 · 1 comment
Closed

Thrown exception during search #68

alankley opened this issue Jun 8, 2023 · 1 comment

Comments

@alankley
Copy link

alankley commented Jun 8, 2023

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
Copy link
Owner

Thanks for reporting.
This pull request will fix the issue #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants