Ciaran Sloan
08/29/2025, 3:40 PMio.ktor.client.engine.darwin.DarwinHttpRequestException: Exception in http request: Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline."
I've tried a simple try/catch around this and it still doesn't seem to catch the error. Has anyone experienced this before? I can't be the first person, but not finding much help online. I've simplified this down to as little as this, to try and isolate from anything else that might be interfering:
try {
db.from(TABLE_USER)
.select {
filter { eq(FIELD_ID, userId) }
}
.decodeSingle<User>()
} catch (t: Throwable) {
Logger.d("SplashViewModel") { "Caught throwable - $t" }
}
But still seeing this happen here only in iOS and not other platformsCiaran Sloan
08/29/2025, 3:43 PMCaught throwable io.github.jan.supabase.exceptions.HttpRequestException
but something else seems to be throwing this DarwinHttpRequestException
that I can't workout where its coming fromJan
08/29/2025, 7:10 PMCiaran Sloan
08/30/2025, 8:35 AMCiaran Sloan
08/30/2025, 9:10 AMclass Greeting {
private val client = HttpClient()
suspend fun greeting(): String {
return try {
client.get("<https://ktor.io/docs/>")
.bodyAsText()
} catch (t: Throwable) {
"Failed to fetch - ${t.message}"
}
}
}
Ciaran Sloan
08/30/2025, 9:19 AMsuspend fun greeting(): String {
return try {
supabaseClient.postgrest.from("outlet")
.select()
.decodeAs<String>()
} catch (t: Throwable) {
"Failed to fetch - ${t.message}"
}
}
This is not crashing and the exception is being caught. So there must be other complexities in my project that are causing problems.
I'll keep digging further to investigate where I'm going wrong, but think we can consider this an issue on my end 🙂Ciaran Sloan
08/30/2025, 9:29 AM