chore: Add complete @Throws annotations to UploadV2Manager for Swift interop#291
Open
chore: Add complete @Throws annotations to UploadV2Manager for Swift interop#291
Conversation
Copilot created this pull request from a session on behalf of
valentinperignon
April 30, 2026 14:52
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to improve Swift/iOS interoperability for the KMP-exposed UploadV2Manager by adding missing @Throws annotations (and aligning KDoc) so exceptions that can propagate through the call chain are visible to Swift callers as NSError rather than surfacing as unexpected Kotlin exceptions.
Changes:
- Added
@Throwsentries acrossUploadV2Managermethods for additional network-layer exceptions (UnauthorizedException,TooManyRequestException, and specificUploadErrorsExceptionsubclasses). - Annotated
encodeSessionRequest/decodeSessionRequestwith@Throws(CancellationException::class)to reflect suspend cancellation propagation. - Updated KDoc
@throwslists to match the newly declared exceptions for the affected methods.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c847afd to
b4a7cea
Compare
b4a7cea to
b2ec269
Compare
e04a8d6 to
202b909
Compare
Agent-Logs-Url: https://github.com/Infomaniak/multiplatform-SwissTransfer/sessions/c606ef6c-fa36-486c-b41d-c35f521cf318 Co-authored-by: valentinperignon <25110022+valentinperignon@users.noreply.github.com>
202b909 to
601881a
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



UploadV2Managerfunctions exposed to iOS via KMP were missing@Throwsdeclarations for exceptions that can propagate through the call chain, making those exceptions invisible to Swift callers.Changes
UnauthorizedException,TooManyRequestException,UploadErrorsExceptionencodeSessionRequest/decodeSessionRequest: added@Throws(CancellationException::class)(were unannotated despite being suspend)prepareTransfer: addedUnauthorizedException,TooManyRequestException(fromuploadRepository.createTransfer)getPendingTransferIfAny: addedUnknownException(thrown byrequireCurrentUserId())getUploadFileChunkUrl/uploadFileChunk: addedUploadErrorsException.NotFoundExceptionfinalizeFileUploadedInChunks/finalizeDirectFileUploaded: addedUploadErrorsException.NotFoundException,UploadErrorsException.TransferCancelledgetUploadFileUrl/uploadFile: addedUploadErrorsException.NotFoundExceptioncancelTransfer: addedUnauthorizedException,TooManyRequestException,UploadErrorsException.NotFoundException,.TransferExpired,.TransferCancelled,.TransferFailedfinalizeTransferAndGetLinkUuid: addedUnauthorizedException,TooManyRequestException,UploadErrorsException.NotFoundException,.TransferExpired,.TransferCancelled@throwsentries updated to match all annotations