Skip to content

chore: Add complete @Throws annotations to UploadV2Manager for Swift interop#291

Open
Copilot wants to merge 4 commits intomainfrom
copilot/add-throws-annotations-uploadv2manager
Open

chore: Add complete @Throws annotations to UploadV2Manager for Swift interop#291
Copilot wants to merge 4 commits intomainfrom
copilot/add-throws-annotations-uploadv2manager

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

UploadV2Manager functions exposed to iOS via KMP were missing @Throws declarations for exceptions that can propagate through the call chain, making those exceptions invisible to Swift callers.

Changes

  • New imports: UnauthorizedException, TooManyRequestException, UploadErrorsException
  • encodeSessionRequest / decodeSessionRequest: added @Throws(CancellationException::class) (were unannotated despite being suspend)
  • prepareTransfer: added UnauthorizedException, TooManyRequestException (from uploadRepository.createTransfer)
  • getPendingTransferIfAny: added UnknownException (thrown by requireCurrentUserId())
  • getUploadFileChunkUrl / uploadFileChunk: added UploadErrorsException.NotFoundException
  • finalizeFileUploadedInChunks / finalizeDirectFileUploaded: added UploadErrorsException.NotFoundException, UploadErrorsException.TransferCancelled
  • getUploadFileUrl / uploadFile: added UploadErrorsException.NotFoundException
  • cancelTransfer: added UnauthorizedException, TooManyRequestException, UploadErrorsException.NotFoundException, .TransferExpired, .TransferCancelled, .TransferFailed
  • finalizeTransferAndGetLinkUuid: added UnauthorizedException, TooManyRequestException, UploadErrorsException.NotFoundException, .TransferExpired, .TransferCancelled
  • KDoc @throws entries updated to match all annotations

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @Throws entries across UploadV2Manager methods for additional network-layer exceptions (UnauthorizedException, TooManyRequestException, and specific UploadErrorsException subclasses).
  • Annotated encodeSessionRequest / decodeSessionRequest with @Throws(CancellationException::class) to reflect suspend cancellation propagation.
  • Updated KDoc @throws lists to match the newly declared exceptions for the affected methods.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@valentinperignon valentinperignon force-pushed the copilot/add-throws-annotations-uploadv2manager branch from c847afd to b4a7cea Compare April 30, 2026 15:10
@valentinperignon valentinperignon changed the title Add complete @Throws annotations to UploadV2Manager for Swift interop chore: Add complete @Throws annotations to UploadV2Manager for Swift interop May 1, 2026
@valentinperignon valentinperignon enabled auto-merge May 1, 2026 04:46
@valentinperignon valentinperignon force-pushed the copilot/add-throws-annotations-uploadv2manager branch from b4a7cea to b2ec269 Compare May 1, 2026 06:53
@valentinperignon valentinperignon force-pushed the copilot/add-throws-annotations-uploadv2manager branch 2 times, most recently from e04a8d6 to 202b909 Compare May 1, 2026 12:41
@valentinperignon valentinperignon force-pushed the copilot/add-throws-annotations-uploadv2manager branch from 202b909 to 601881a Compare May 1, 2026 12:52
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants