RoadReport / RoadReport_AndroidClient

「看路!」的 Android 專案,架構很亂btw
https://play.google.com/store/apps/details?id=com.txwstudio.app.roadreport
Apache License 2.0
0 stars 0 forks source link

上傳圖片 Timeout #10

Closed MrNegativeTW closed 3 years ago

MrNegativeTW commented 3 years ago

目標圖片

IMAG0634.jpg 3.33 MB

Log

Highlight

com.txwstudio.app.roadreport.ui.eventeditor.EventEditorFragment$sendImageAndGetLink$1.invokeSuspend(EventEditorFragment.kt:210)

Full log

E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-2
    Process: com.txwstudio.app.roadreport, PID: 14868
    java.net.SocketTimeoutException: timeout
        at okio.Okio$4.newTimeoutException(Okio.java:232)
        at okio.AsyncTimeout.exit(AsyncTimeout.java:286)
        at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
        at okio.RealBufferedSource.indexOf(RealBufferedSource.java:358)
        at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:230)
        at okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.java:242)
        at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:213)
        at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115)
        at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
        at okhttp3.RealCall.execute(RealCall.java:81)
        at retrofit2.OkHttpCall.execute(OkHttpCall.java:204)
        at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall.execute(DefaultCallAdapterFactory.java:108)
        at com.txwstudio.app.roadreport.ui.eventeditor.EventEditorFragment$sendImageAndGetLink$1.invokeSuspend(EventEditorFragment.kt:210)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
     Caused by: java.net.SocketException: socket is closed
        at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(:com.google.android.gms@202414019@20.24.14 (040400-319035315):7)
        at okio.Okio$2.read(Okio.java:140)
        at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
        at okio.RealBufferedSource.indexOf(RealBufferedSource.java:358) 
        at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:230) 
        at okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.java:242) 
        at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:213) 
        at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115) 
        at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94) 
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) 
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43) 
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) 
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) 
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94) 
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) 
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) 
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) 
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) 
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88) 
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) 
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) 
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229) 
        at okhttp3.RealCall.execute(RealCall.java:81) 
        at retrofit2.OkHttpCall.execute(OkHttpCall.java:204) 
        at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall.execute(DefaultCallAdapterFactory.java:108) 
        at com.txwstudio.app.roadreport.ui.eventeditor.EventEditorFragment$sendImageAndGetLink$1.invokeSuspend(EventEditorFragment.kt:210) 
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) 
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 
MrNegativeTW commented 3 years ago

Add error handling for image upload

625ac37