kable icon indicating copy to clipboard operation
kable copied to clipboard

GattRequestRejectedException in common code

Open francismariano opened this issue 3 years ago • 1 comments

Hello everyone. The GattRequestRejectedException is declared in Android module. Thus it is not possible catch it in common code. Is it possible declared it in common module of kable library?

Thank you.

francismariano avatar Jun 03 '22 13:06 francismariano

The current exception hierarchy is as follows:

  • Exception
    • BluetoothException
      • BluetoothDisabledException
      • GattRequestRejectedException (Android-only)
    • IOException
      • NotConnectedException
        • NotReadyException
        • ConnectionLostException
      • ConnectionRejectedException
      • GattStatusException

Would it suffice for you to catch BluetoothException?

In general, the exception organization in Kable could use some re-structuring (e.g. #177), so I'm open to changing things up a bit, but I'm reluctant to move GattRequestRejectedException to common code as it is a state specific to Android.

Is there a reason BluetoothException won't suffice in common code?

twyatt avatar Aug 03 '22 08:08 twyatt