I'm making an edge function call that failed. The ...
# supabase-kt
c
I'm making an edge function call that failed. The stack trace is helpful because i have an error msg from the function... but why doesn't it take me to the callsite? is that because of general weirdness with coroutine staack traces?
FWIW. this is how im calling it
Copy code
onClick = {                                    coroutineScope.launch(Dispatchers.IO) {
  uploading = true
  val response =                                      supabaseClient.functions.invoke("do-thing") {
j
Whats the stacktrace?
c
Copy code
19:12:00.559  E  FATAL EXCEPTION: DefaultDispatcher-worker-5
Process: <http://com.rollertoaster.app|com.rollertoaster.app>, PID: 30447
io.github.jan.supabase.exceptions.UnauthorizedRestException: {"error":"Not enough time"}
URL: <https://myapp.supabase.co/functions/v1/insert-row>
Headers: [Authorization=[Bearer AUTH], x-region=[any], apikey=[], X-Client-Info=[supabase-kt/3.1.4], Accept=[application/json], Accept-Charset=[UTF-8]]
Http Method: POST
at io.github.jan.supabase.functions.Functions.parseErrorResponse(Functions.kt:134)
at io.github.jan.supabase.auth.AuthenticatedSupabaseApiKt$authenticatedSupabaseApi$3.invoke(AuthenticatedSupabaseApi.kt:60)
at io.github.jan.supabase.auth.AuthenticatedSupabaseApiKt$authenticatedSupabaseApi$3.invoke(AuthenticatedSupabaseApi.kt:60)
at io.github.jan.supabase.network.SupabaseApi.rawRequest$suspendImpl(SupabaseApi.kt:25)
at io.github.jan.supabase.network.SupabaseApi$rawRequest$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@14566ff, androidx.compose.runtime.BroadcastFrameClock@828bccc, StandaloneCoroutine{Cancelling}@4a6bb15, <http://Dispatchers.IO]|Dispatchers.IO]>
j
Ah thats probably because the exception object is created in the
parseErrorResponse
method but not thrown from there. Maybe we can change that 🤔
c
oh cool. seems like it rings a bell to you. but yeah. I was hoping for a trace that would lead me right to my calling code.
@ jan do you think its worth filing a FR for this? hit me again today. lol
j
sure