Scoop API

scoop:scoop.http.client:0.1.0

src/download/errors.scoop

Selected production source · src/download/errors.scoop

1package scoop.http.client
3internal fun recordClientDownloadFailure(download: ClientDownload, error: Throwable) {
4 download.client.lock.withLock {
5 val primary = download.failure
6 if (!clientPresent(primary)) {
7 if (error is ResourceUseException) {
8 download.failure = Some(error.primaryFailure)
9 download.cleanupFailure = collectClientSecondary(error.primaryFailure, download.cleanupFailure, error.cleanupFailure)
10 } else download.failure = Some(error)
11 } else download.cleanupFailure = collectClientSecondary(primary!!, download.cleanupFailure, error)
12 Unit
13 }
16internal fun clientDownloadFailure(download: ClientDownload): Throwable? = download.client.lock.withLock {
17 when (download.cleanupFailure) {
18 case Some(val cleanup) -> Some(clientCombined(download.failure, cleanup))
19 case None -> download.failure
20 }