diff --git a/AGENTS.md b/AGENTS.md index 203e81bd..bb7fe9a1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -39,7 +39,7 @@ clarify uncertainty before coding, and align suggestions with the rules linked b - Use commits in `(): summary` format; squash fixups locally before sharing ## Testing -[Fill in by LLM assistant] +- `swift test`: Run the SwiftPM test suite ## Environment [Fill in by LLM assistant] diff --git a/CHANGELOG.md b/CHANGELOG.md index ec8ef6d1..2fe2e60c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 3.8.0 + +## Breaking changes +- `TUSClientError.couldNotGetFileStatus` now includes an `underlyingError` for better diagnostics. + # 3.7.0 - Removed cocoapods support diff --git a/Sources/TUSKit/TUSClientError.swift b/Sources/TUSKit/TUSClientError.swift index 61a23684..9615fa72 100644 --- a/Sources/TUSKit/TUSClientError.swift +++ b/Sources/TUSKit/TUSClientError.swift @@ -10,7 +10,7 @@ public enum TUSClientError: Error, LocalizedError { case couldNotStoreFileMetadata(underlyingError: Error) case couldNotCreateFileOnServer(underlyingError: Error) case couldNotUploadFile(underlyingError: Error) - case couldNotGetFileStatus + case couldNotGetFileStatus(underlyingError: Error) case fileSizeMismatchWithServer case couldNotDeleteFile(underlyingError: Error) case uploadIsAlreadyFinished @@ -40,8 +40,8 @@ public enum TUSClientError: Error, LocalizedError { return "Could not create file on server: (\(underlyingError.localizedDescription))" case .couldNotUploadFile(let underlyingError): return "Could not upload file: \(underlyingError.localizedDescription)" - case .couldNotGetFileStatus: - return "Could not get file status." + case .couldNotGetFileStatus(let underlyingError): + return "Could not get file status: \(underlyingError.localizedDescription)" case .fileSizeMismatchWithServer: return "File size mismatch with server." case .couldNotDeleteFile(let underlyingError): diff --git a/Sources/TUSKit/Tasks/StatusTask.swift b/Sources/TUSKit/Tasks/StatusTask.swift index 9c0401e9..ce22fb05 100644 --- a/Sources/TUSKit/Tasks/StatusTask.swift +++ b/Sources/TUSKit/Tasks/StatusTask.swift @@ -98,7 +98,7 @@ final class StatusTask: IdentifiableTask { } catch let error as TUSClientError { completed(.failure(error)) } catch { - completed(.failure(TUSClientError.couldNotGetFileStatus)) + completed(.failure(TUSClientError.couldNotGetFileStatus(underlyingError: error))) } } }