AAkira / Napier

Logging library for Kotlin Multiplatform
Apache License 2.0
831 stars 37 forks source link

Handling Swift exceptions #99

Closed akoshkidko closed 2 years ago

akoshkidko commented 2 years ago

Hello @AAkira

I develop KMM app and want to use Napier both for Android and iOS.

According to Napier README.md we can handle errors in Kotlin code like that

fun handleError() {
    try {
            throw Exception("throw error")
        } catch (e: Exception) {
            Napier.e("Napier Error", e)
    }
}

Is is possible to handle Error / NSError in a similar way in Swift code? May be another way to handle exceptions in iOS app?

AAkira commented 2 years ago

You should check here. I recommend Kotlin lang slack to ask questions for KMM.

https://kotlinlang.org/docs/native-objc-interop.html#mappings