@@ -19,8 +19,53 @@ public enum TUSClientError: Error {
1919 case couldnotRemoveFinishedUploads( underlyingError: Error )
2020 case receivedUnexpectedOffset
2121 case missingRemoteDestination
22- case emptyUploadRange
2322 case rangeLargerThanFile
2423 case taskCancelled
2524 case customURLSessionWithBackgroundConfigurationNotSupported
25+ case emptyUploadRange
26+
27+ public var localizedDescription : String {
28+ switch self {
29+ case . couldNotCopyFile( let underlyingError) :
30+ return " Could not copy file: \( underlyingError. localizedDescription) "
31+ case . couldNotStoreFile( let underlyingError) :
32+ return " Could not store file: \( underlyingError. localizedDescription) "
33+ case . fileSizeUnknown:
34+ return " The file size is unknown. "
35+ case . couldNotLoadData( let underlyingError) :
36+ return " Could not load data: \( underlyingError. localizedDescription) "
37+ case . couldNotStoreFileMetadata( let underlyingError) :
38+ return " Could not store file metadata: \( underlyingError. localizedDescription) "
39+ case . couldNotCreateFileOnServer:
40+ return " Could not create file on server. "
41+ case . couldNotUploadFile( let underlyingError) :
42+ return " Could not upload file: \( underlyingError. localizedDescription) "
43+ case . couldNotGetFileStatus:
44+ return " Could not get file status. "
45+ case . fileSizeMismatchWithServer:
46+ return " File size mismatch with server. "
47+ case . couldNotDeleteFile( let underlyingError) :
48+ return " Could not delete file: \( underlyingError. localizedDescription) "
49+ case . uploadIsAlreadyFinished:
50+ return " The upload is already finished. "
51+ case . couldNotRetryUpload:
52+ return " Could not retry upload. "
53+ case . couldNotResumeUpload:
54+ return " Could not resume upload. "
55+ case . couldnotRemoveFinishedUploads( let underlyingError) :
56+ return " Could not remove finished uploads: \( underlyingError. localizedDescription) "
57+ case . receivedUnexpectedOffset:
58+ return " Received unexpected offset. "
59+ case . missingRemoteDestination:
60+ return " Missing remote destination for upload. "
61+ case . emptyUploadRange:
62+ return " The upload range is empty. "
63+ case . rangeLargerThanFile:
64+ return " The upload range is larger than the file size. "
65+ case . taskCancelled:
66+ return " The task was cancelled. "
67+ case . customURLSessionWithBackgroundConfigurationNotSupported:
68+ return " Custom URLSession with background configuration is not supported. "
69+ }
70+ }
2671}
0 commit comments