Mihai Voicescu
10/15/2021, 3:59 PMVampire
10/15/2021, 4:23 PMMihai Voicescu
10/15/2021, 4:51 PMfun foo(): Result<Unit, Foo>
Joffrey
10/15/2021, 4:56 PMMihai Voicescu
10/15/2021, 5:11 PMkotlin-result
seems to be very similar, but the fact that it's name collides with the std make it very annoying to use.
Was also curios what was the usual way to handle this cases in Kotlin.Vampire
10/15/2021, 6:27 PMfun foo(): Result<Unit>
.
What is the reason you need to specify the type?Joffrey
10/15/2021, 7:19 PMrunCatching
), which allows to access the specific exception instance after the fact if needed
• if failure is expected and controlled (or at least used meaningfully), you can defined your own sealed class to represent different type of errorsAlexander Levin
10/15/2021, 7:57 PMMihai Voicescu
10/18/2021, 8:44 AMkotlin-result
version (which still needs the Error types to be defined as a sealed class)Nick
10/29/2021, 3:35 PMResult
?Mihai Voicescu
10/29/2021, 5:57 PM