Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit43fc898

Browse files
committed
add url to network error
1 parent425f341 commit43fc898

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎Coder Desktop/VPNLib/Download.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public func download(src: URL, dest: URL, urlSession: URLSession) async throws(D
116116
do{
117117
(tempURL, response)=tryawait urlSession.download(for: req)
118118
}catch{
119-
throw.networkError(error)
119+
throw.networkError(error, url: src.absoluteString)
120120
}
121121
defer{
122122
ifFileManager.default.fileExists(atPath: tempURL.path){
@@ -155,15 +155,15 @@ func etag(data: Data) -> String {
155155
publicenumDownloadError:Error{
156156
case unexpectedStatusCode(Int)
157157
case invalidResponse
158-
case networkError(anyError)
158+
case networkError(anyError, url:String)
159159
case fileOpError(anyError)
160160

161161
publicvardescription:String{
162162
switchself{
163163
caselet.unexpectedStatusCode(code):
164164
"Unexpected HTTP status code:\(code)"
165-
caselet.networkError(error):
166-
"Network error:\(error.localizedDescription)"
165+
caselet.networkError(error, url):
166+
"Network error:\(url) -\(error.localizedDescription)"
167167
caselet.fileOpError(error):
168168
"File operation error:\(error.localizedDescription)"
169169
case.invalidResponse:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp