This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Improve stacktrace on connection loss for bluetooth request #49
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rethrow `ConnectionLost` from `CoroutinesGatt.performBluetoothAction` to provide more informative stacktrace. ## Before ```java com.juul.able.gatt.ConnectionLost at com.juul.able.gatt.GattCallback.onDisconnecting(GattCallback.kt:39) at com.juul.able.gatt.GattCallback.close(GattCallback.kt:45) at com.juul.able.gatt.GattCallback.onConnectionStateChange(GattCallback.kt:65) at android.bluetooth.BluetoothGatt$1$4.run(BluetoothGatt.java:272) at android.bluetooth.BluetoothGatt.runOrQueueCallback(BluetoothGatt.java:780) at android.bluetooth.BluetoothGatt.access$200(BluetoothGatt.java:41) at android.bluetooth.BluetoothGatt$1.onClientConnectionState(BluetoothGatt.java:267) at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:192) at android.os.Binder.execTransactInternal(Binder.java:1021) at android.os.Binder.execTransact(Binder.java:994) ``` ## After ```java com.juul.able.gatt.GattResponseFailure: Failed to receive response for discoverServices at com.juul.able.gatt.CoroutinesGatt.discoverServices(CoroutinesGatt.kt:186) at com.juul.able.gatt.CoroutinesGatt$discoverServices$1.invokeSuspend(Unknown Source:11) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:55) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Caused by: com.juul.able.gatt.ConnectionLost at com.juul.able.gatt.GattCallback.onDisconnecting(GattCallback.kt:39) at com.juul.able.gatt.GattCallback.close(GattCallback.kt:45) at com.juul.able.gatt.GattCallback.onConnectionStateChange(GattCallback.kt:65) at android.bluetooth.BluetoothGatt$1$4.run(BluetoothGatt.java:272) at android.bluetooth.BluetoothGatt.runOrQueueCallback(BluetoothGatt.java:780) at android.bluetooth.BluetoothGatt.access$200(BluetoothGatt.java:41) at android.bluetooth.BluetoothGatt$1.onClientConnectionState(BluetoothGatt.java:267) at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:192) at android.os.Binder.execTransactInternal(Binder.java:1021) at android.os.Binder.execTransact(Binder.java:994) ```
twyatt
changed the title
Improve stacktrace for connection loss during bluetooth request
Improve stacktrace on connection loss for bluetooth request
Apr 10, 2020
Codecov Report
@@ Coverage Diff @@
## develop #49 +/- ##
=============================================
- Coverage 74.38% 73.46% -0.92%
- Complexity 35 36 +1
=============================================
Files 14 14
Lines 242 245 +3
Branches 28 28
=============================================
Hits 180 180
- Misses 52 55 +3
Partials 10 10
|
davidtaylor-juul
approved these changes
Apr 10, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rethrow
ConnectionLost
fromCoroutinesGatt.performBluetoothAction
to provide more informative stacktrace.Before
After