scoop:scoop.http.client:0.1.0
src/download/errors.scoop
Selected production source · src/download/errors.scoop
1
package scoop.http.client3
internal fun recordClientDownloadFailure(download: ClientDownload, error: Throwable) {4
download.client.lock.withLock {5
val primary = download.failure6
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
Unit13
}14
}16
internal 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.failure20
}21
}