@@ -116,7 +116,7 @@ public func download(src: URL, dest: URL, urlSession: URLSession) async throws(D
116
116
do {
117
117
( tempURL, response) = try await urlSession. download ( for: req)
118
118
} catch {
119
- throw . networkError( error)
119
+ throw . networkError( error, url : src . absoluteString )
120
120
}
121
121
defer {
122
122
if FileManager . default. fileExists ( atPath: tempURL. path) {
@@ -155,15 +155,15 @@ func etag(data: Data) -> String {
155
155
public enum DownloadError : Error {
156
156
case unexpectedStatusCode( Int )
157
157
case invalidResponse
158
- case networkError( any Error )
158
+ case networkError( any Error , url : String )
159
159
case fileOpError( any Error )
160
160
161
161
public var description : String {
162
162
switch self {
163
163
case let . unexpectedStatusCode( code) :
164
164
" Unexpected HTTP status code: \( code) "
165
- case let . networkError( error) :
166
- " Network error: \( error. localizedDescription) "
165
+ case let . networkError( error, url ) :
166
+ " Network error: \( url ) - \( error. localizedDescription) "
167
167
case let . fileOpError( error) :
168
168
" File operation error: \( error. localizedDescription) "
169
169
case . invalidResponse: