I’ve been reading through the <SKIE migration docs...
# touchlab-tools
u
I’ve been reading through the SKIE migration docs and am really looking forward to migrate! 🚀 Thanks a million for open sourcing it! ❤️ However, there is one debatable design decision (as you are already pointing out in the blog post yourself 😅):
One real difference between other Coroutines interop solutions and SKIE is that SKIE does not throw exceptions from the underlying
Flow
. Your Kotlin code will need to deal with exceptions appropriately in its logic rather than expecting that to throw to Swift. Philosophically, this is how we (Touchlab) generally view error handling and KMP. If you’re expecting an error, catch it and make error states an explicit part of the API rather than just letting them bubble up to Swift. However, other developers may not prefer that approach.
In our project we already have result object wrappers with error states (we are using [Resultat](https://github.com/nicolashaan/resultat) for that), so we should be fine. But more generally: why change the Flow exception propagation behavior compared to how it would work if the Flow was consumed from Kotlin code, thereby introducing additional stuff to keep in the back of one’s mind when developing shared module code? Is there some technical reason? And if not, why not make this configurable? Would this introduce a lot of complexity in the code generation?
f
Adding support for exception propagation to flows is certainly possible. We would “just” need to generate a slightly different code that would use AsyncThrowingStream instead of AsyncStream. So the only reason why this feature isn’t there yet is that we just haven’t found the time to do it yet 😄 The thing with SKIE is that even conceptually “simple” things can take quite a lot of work and there are many competing features that we could work on. So we need to prioritize them. So far we have done that mostly based on our experience with KMP, but since SKIE is now open source we are looking for community feedback. So if you are interested in having this feature, please create a ticket in Github.
u
Thanks for the quick reply Filip, I didn’t want to sound offensive or ungrateful. You people did an outstanding job with SKIE! 🤗 I merely wanted to let you know about my point of view regarding the topic as feedback on this matter was requested in the migration blog post. I’m going to create a ticket in Github as you suggested. 🙌
t
Hey Sven, thanks for this feedback. Don't worry, we understood how you meant it and didn't take it as offensive or ungrateful 🙂 Thank you for creating the issue, much appreciated!
🙌 1