Skip to content

feat: Kotlin update and @Throws annotations - #32

Merged
tomhula merged 2 commits into
tomhula:mainfrom
jzitnik-dev:kotlin-upgrade
Aug 3, 2026
Merged

feat: Kotlin update and @Throws annotations#32
tomhula merged 2 commits into
tomhula:mainfrom
jzitnik-dev:kotlin-upgrade

Conversation

@jzitnik-dev

Copy link
Copy Markdown
Collaborator
  1. Updated to the new kotlin mutliplatform version that doesn't have the regex negative lookahead bug.
  2. Added @Throws annotations on interface functions for native Swift code.
    This is required for the function to gracefully hand the exception in the native Swift code rather than panicing and crashing the whole app using the function.
    The RuntimeException in the @Throws is to catch any exceptions that ktor might throw. Afaik there is no single exception like KtorException that we could reference all of the possible ktor exception, so I think this is the best way of doing so, while not forcing JVM users to handle every function with try catch, and we don't have to list out all of the possible Exceptions ktor might throw.

Note: The @Throws isn't specifically required in this Kotlin version, that's for all of them, i just didn't feel like making PR just to update single version number. You can make this to be two commits rather than squash if you want it separate.

Add `@Throws` annotations to the `JecnaClient` and `CanteenClient` interfaces to establish explicit error contracts for Kotlin Multiplatform consumers. This provides typed error support for Swift.
@jzitnik-dev
jzitnik-dev requested a review from tomhula August 2, 2026 17:46
@tomhula
tomhula merged commit cb4b664 into tomhula:main Aug 3, 2026
2 checks passed
@jzitnik-dev
jzitnik-dev deleted the kotlin-upgrade branch August 3, 2026 13:25
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.

2 participants