Better error

This commit is contained in:
Koen J 2024-08-29 17:57:55 +02:00
parent 9376bb05fa
commit 0b4770188c
2 changed files with 8 additions and 3 deletions

View file

@ -706,7 +706,12 @@ class VideoDownload {
}
else {
Logger.i(TAG, "Download $name Sequential");
sourceLength = downloadSource_Sequential(client, fileStream, videoUrl, onProgress);
try {
sourceLength = downloadSource_Sequential(client, fileStream, videoUrl, onProgress);
} catch (e: Throwable) {
Logger.w(TAG, "Failed to download sequentially (url = $videoUrl)")
throw e
}
}
Logger.i(TAG, "$name downloadSource Finished");

View file

@ -51,8 +51,8 @@ class DownloadService : Service() {
private val _client = ManagedHttpClient(OkHttpClient.Builder()
//.proxy(Proxy(Proxy.Type.HTTP, InetSocketAddress(InetAddress.getByName("192.168.1.175"), 8081)))
.readTimeout(Duration.ofSeconds(30))
.writeTimeout(Duration.ofSeconds(30))
.readTimeout(Duration.ofMinutes(30))
.writeTimeout(Duration.ofMinutes(30))
.connectTimeout(Duration.ofSeconds(30))
.callTimeout(Duration.ofMinutes(30)))