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

Throw an exception if requestDevice() filters include no services #144

Merged
merged 2 commits into from
Jul 24, 2015

Conversation

jyasskin
Copy link
Member

@@ -24,6 +24,14 @@ This document attempts to explain why various decisions were made the way they w
* While the <a>Server</a> role can work in a <a>Central</a> device,
<a>Client</a> is more natural and is required for more use cases.

## Why does `requestDevice()` require non-empty filters?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kenchris commented on c189c76 that "Maybe it should then be called requestDeviceMatching(...) or similar to make this more obvious?"

I'm not sure it needs to be more obvious than getting a TypeError when you forget to pass filters.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think requestDevice is sufficient, and that adding Matching doesn't add value to warrant the name complexity.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@scheib
Copy link
Contributor

scheib commented Jul 24, 2015

LGTM, though I offer a possible further explanation https://github.com/WebBluetoothCG/web-bluetooth/pull/144/files#r35387445

jyasskin added a commit that referenced this pull request Jul 24, 2015
Throw an exception if requestDevice() filters include no services
@jyasskin jyasskin merged commit b35e737 into WebBluetoothCG:gh-pages Jul 24, 2015
@jyasskin jyasskin deleted the loud-empty-filters branch July 24, 2015 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants