smanikandan14 / ThinDownloadManager

To download files and to avoid using DOWNLOAD_WITHOUT_NOTIFICATION permission if you are using Android's DownloadManager in your apps.
Apache License 2.0
783 stars 186 forks source link

java.net.SocketTimeoutException #84

Closed wenyang9319 closed 7 years ago

wenyang9319 commented 7 years ago

I was testing ThinDownloadManager with a bad internet connection situation, and the following error prompts out:

W/System.err: at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488) W/System.err: at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37) W/System.err: at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237) W/System.err: at com.android.okio.Okio$2.read(Okio.java:116) W/System.err: at com.android.okio.RealBufferedSource.indexOf(RealBufferedSource.java:150) W/System.err: at com.android.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:97) W/System.err: at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:202) W/System.err: at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:119) W/System.err: at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:798) W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:405) W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:349) W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:517) W/System.err: at com.thin.downloadmanager.DownloadDispatcher.executeDownload(DownloadDispatcher.java:136) W/System.err: at com.thin.downloadmanager.DownloadDispatcher.run(DownloadDispatcher.java:84)

Anyway to handle this? I was pass in the RetryPolicy but it didn't catch this error. Further, onDownloadFailed from DownloadStatusListenerV1 didn't trigger.

wenyang9319 commented 7 years ago

@smanikandan14
Any thoughts would be appreciate =)

wangzhengyi commented 7 years ago

DownloadDispatcher already catch SocketTimeOutException, and use e.printStackTrace(); tell user this exception. so it is not error, it just a log for this exception.

smanikandan14 commented 7 years ago

Agreed with @wangzhengyi . Closing this as not an issue.