Skip to content

Commit

Permalink
Update download error wording
Browse files Browse the repository at this point in the history
  • Loading branch information
sukov committed Aug 21, 2022
1 parent fe90ce0 commit 07dbbc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/ResourceLoaderDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ final class ResourceLoaderDelegate: NSObject, AVAssetResourceLoaderDelegate, URL
} else if shouldVerifyDownloadedFileSize && response.expectedContentLength != -1 && response.expectedContentLength != fileHandle.fileSize {
error = NSError(domain: "Failed downloading asset. Reason: wrong file size, expected: \(response.expectedContentLength), actual: \(fileHandle.fileSize).", code: response.statusCode, userInfo: nil)
} else if minimumExpectedFileSize > 0 && minimumExpectedFileSize > fileHandle.fileSize {
error = NSError(domain: "Failed downloading asset. Reason: wrong file size, expected: \(response.expectedContentLength), actual: \(fileHandle.fileSize).", code: response.statusCode, userInfo: nil)
error = NSError(domain: "Failed downloading asset. Reason: file size \(fileHandle.fileSize) is smaller than minimumExpectedFileSize", code: response.statusCode, userInfo: nil)
}

return error
Expand Down

0 comments on commit 07dbbc1

Please sign in to comment.