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