How do you guys handle errors in KMM?
For example, I have this use case
interface SignInUseCase {
@Throws(Exception::class)
suspend fun execute(email: String, password: String): Whatever
}
When I call this from iOS, I get
signInUseCase.execute(email: email, password: password) { whatever, error in
// Handle completion
}
Is there a way to have a custom error here, instead of NSError? Ideally, I'd like to have maybe a class or data class
data class Error(
val title: String
val detail: String
}