Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate unknown onScanFailed error codes as IllegalStateExceptions #851

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

twyatt
Copy link
Member

@twyatt twyatt commented Jan 31, 2025

I had hoped that the error codes defined in ScanCallback were exhaustive.

...apparently they are not.

Additionally, I had hoped that I could look up specific error codes as they were reported (e.g. 100 reported in #850), but I couldn't find anything specific/concrete about error code 100. Which means I can't even provide a helpful failure message for it; Kable just needs to do what other Android source code does (and default to Unknown). 😢

This PR changes failure behavior of scanning (when an unknown error code is hit), to throw IllegalStateException instead of InternalException.

Closes #850

@twyatt twyatt added the patch Changes that should bump the PATCH version number label Jan 31, 2025
@twyatt twyatt marked this pull request as ready for review February 1, 2025 05:19
@twyatt twyatt requested a review from a team as a code owner February 1, 2025 05:19
@twyatt twyatt requested review from sdonn3 and cedrickcooke February 1, 2025 05:19
@twyatt twyatt added this to the 0.36.0 milestone Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Changes that should bump the PATCH version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScanError.toString-impl com.juul.kable.InternalException - Unsupported error code 100
2 participants