https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

Adriano Celentano

09/11/2019, 8:39 AM
someone else exeperienced exceptions thrown by retrofit which are not caught by the try catch surounding the call ?
p

Paul Woitaschek

09/11/2019, 8:40 AM
Which retrofit version are you using?
a

Adriano Celentano

09/11/2019, 8:41 AM
just updated to 2.6.1
p

Paul Woitaschek

09/11/2019, 8:41 AM
And it’s still happening?
a

Adriano Celentano

09/11/2019, 11:11 AM
jep
p

Paul Woitaschek

09/11/2019, 11:15 AM
Can you post the code where it throws and which exceptions are thrown?
a

Adriano Celentano

09/11/2019, 11:44 AM
Copy code
GlobalScope.launch(handler) {
            try {
                someSuspendingFunctionWhichAlsoCallsRetrofit()
            } catch (it: Throwable) {
                logError(it)
            }
        }
--> E/AndroidRuntime: FATAL EXCEPTION: main
catch and exceptionHandler are not called just get this Androidruntime exception (which should be a unknownhostexception, but is appreaently cut by android since some newer versions )
in the end i maed my retrofit client blocking an wrapped it myself in coroutines
2 Views