Skip to content

🐛 Bug Report: App crash on no-internet #72

@buddy-dev-1337

Description

@buddy-dev-1337

👟 Reproduction steps

I'm not able to consistently reproduce this but whenever there is network issues and the SDK tries to make a request it crashes the whole app itself rather than catching the exception

         Fatal Exception: java.net.UnknownHostException: Unable to resolve host "cloud.appwrite.io": No address associated with hostname
               at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156)
               at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
               at java.net.InetAddress.getAllByName(InetAddress.java:1152)
               at okhttp3.Dns$Companion$DnsSystem.lookup(Dns.kt:1)
               at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:413)
               at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:413)
               at okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:413)
               at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:413)
               at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:413)
               at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:60)
               at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.java:60)
               at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:60)
               at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:1)
               at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:156)
               at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:1)
               at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:235)
               at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:1)
               at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:149)
               at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:1)
               at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:100)
               at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:48)
               at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
               at java.lang.Thread.run(Thread.java:1012)

### 👍 Expected behavior

Should not crash the app but rather catch the exception

### 👎 Actual Behavior

Crashes the app

### 🎲 Appwrite version

io.appwrite:sdk-for-android:6.0.0

### 💻 Operating system

Android 

### 🧱 Your Environment

_No response_

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [x] I have read the [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions