Using `sealed class` to group exceptions together
# android
v
Using
sealed class
to group exceptions together
Hello, is this considered a good practice to group related exceptions together in Kotlin?
Copy code
sealed class BluetoothException : Exception() {
    class BluetoothNotEnabled : BluetoothException()
    class PrinterNotFound : BluetoothException()
    class PrinterConnectionFailed(override val message: String?) : BluetoothException()
}
d
Yes
1