turms-im / turms

🕊️ The world's most advanced open source instant messaging engine for 100K~10M concurrent users https://turms-im.github.io/docs
Apache License 2.0
1.72k stars 266 forks source link

Mention the exception of throwable type on turms-client-kotlin #614

Open JamesChenX opened 3 years ago

JamesChenX commented 3 years ago

Because of the null safety feature of Kotlin, it checks whether the caller passes a null value to a not-nullable param, and throws NullPointerException if it happens.

Generally, the implementations of turms client should wrap any exception as a TurmsBusinessException/Error, but the NPE better be an exception for now. Otherwise, we have to modify the bytecode just to wrap the NPE, it's over-engineering.

We may wrap it in the future, but definitely not for now.