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

Refactor Bluetooth error handling #12538

Merged
merged 1 commit into from Jul 28, 2016

Conversation

Projects
None yet
6 participants
@zakorgy
Contributor

zakorgy commented Jul 21, 2016

Replace the error messages with an enum in net/bluetooth_thread.rs. Rename bluetooth_blacklist.rs to bluetooth_utils.rs and put the error conversion in it.
With this the returned errors in DOM classes follow the specification.

  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because there is no Web Bluetooth test API implementation yet.

This change is Reviewable

@highfive

This comment has been minimized.

highfive commented Jul 21, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/bluetoothremotegattserver.rs, components/script/lib.rs, components/net_traits/bluetooth_thread.rs, components/net_traits/bluetooth_thread.rs, components/script/bluetooth_utils.rs, components/script/dom/bluetoothremotegattservice.rs, components/net/bluetooth_thread.rs, components/script/dom/bluetooth.rs, components/script/dom/bluetoothremotegattdescriptor.rs, components/script/bluetooth_blacklist.rs, components/script/dom/bluetoothremotegattcharacteristic.rs
@highfive

This comment has been minimized.

highfive commented Jul 21, 2016

warning Warning warning

  • These commits modify net and script code, but no tests are modified. Please consider adding a test!
@zakorgy

This comment has been minimized.

Contributor

zakorgy commented Jul 21, 2016

@jdm

This comment has been minimized.

Member

jdm commented Jul 21, 2016

r? @jdm

@highfive highfive assigned jdm and unassigned metajack Jul 21, 2016

@nox nox assigned nox and unassigned jdm Jul 25, 2016

@nox nox removed the S-awaiting-review label Jul 25, 2016

@nox

This comment has been minimized.

Member

nox commented Jul 25, 2016

-S-awaiting-review +S-needs-code-changes +S-awaiting-answer

Just one nit and a question, thanks for your contribution!


Reviewed 10 of 10 files at r1.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


components/net/bluetooth_thread.rs, line 507 [r1] (raw file):

                return drop(sender.send(Err(BluetoothError::Network)));
            },
            None => return drop(sender.send(Err(BluetoothError::Network))),

Not NotFound for this one?


components/script/bluetooth_utils.rs, line 128 [r1] (raw file):

}

pub fn handle_bluetooth_error(error: BluetoothError) -> Error {

Nit: make that an impl From<BluetoothError> for Error.


Comments from Reviewable

@zakorgy

This comment has been minimized.

Contributor

zakorgy commented Jul 26, 2016

components/net/bluetooth_thread.rs, line 507 [r1] (raw file):

Previously, nox (Anthony Ramine) wrote…

Not NotFound for this one?

You are correct.

Comments from Reviewable

@nox

This comment has been minimized.

Member

nox commented Jul 27, 2016

Thanks! Please squash the commits together and I'll accept the PR.

-S-awaiting-answer -S-awaiting-review +S-needs-squash


Reviewed 9 of 9 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


Comments from Reviewable

@nox nox added the S-needs-squash label Jul 27, 2016

@nox

This comment has been minimized.

Member

nox commented Jul 27, 2016

bors-servo added a commit that referenced this pull request Jul 27, 2016

Auto merge of #12538 - szeged:error-refactor, r=<try>
Refactor Bluetooth error handling

<!-- Please describe your changes on the following line: -->
Replace the error messages with an enum in `net/bluetooth_thread.rs`. Rename `bluetooth_blacklist.rs` to `bluetooth_utils.rs` and put the error conversion in it.
With this the returned errors in DOM classes follow the specification.
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because  there is no Web Bluetooth test API implementation yet.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12538)
<!-- Reviewable:end -->
@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Jul 27, 2016

⌛️ Trying commit 9bf0c8b with merge 70557fb...

@zakorgy zakorgy force-pushed the szeged:error-refactor branch from 9bf0c8b to e8495b5 Jul 27, 2016

@zakorgy zakorgy force-pushed the szeged:error-refactor branch from e8495b5 to b4db144 Jul 27, 2016

@jdm

This comment has been minimized.

Member

jdm commented Jul 27, 2016

@bors-servo: r=nox

@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Jul 27, 2016

📌 Commit b4db144 has been approved by nox

@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Jul 28, 2016

⌛️ Testing commit b4db144 with merge 05fdc62...

bors-servo added a commit that referenced this pull request Jul 28, 2016

Auto merge of #12538 - szeged:error-refactor, r=nox
Refactor Bluetooth error handling

<!-- Please describe your changes on the following line: -->
Replace the error messages with an enum in `net/bluetooth_thread.rs`. Rename `bluetooth_blacklist.rs` to `bluetooth_utils.rs` and put the error conversion in it.
With this the returned errors in DOM classes follow the specification.
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because  there is no Web Bluetooth test API implementation yet.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12538)
<!-- Reviewable:end -->
@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Jul 28, 2016

💔 Test failed - linux-rel

@highfive

This comment has been minimized.

highfive commented Jul 28, 2016

  ▶ Unexpected subtest result in /html/browsers/browsing-the-web/history-traversal/browsing_context_name.html:
  └ PASS [expected FAIL] Retaining window.name on history traversal
@nox

This comment has been minimized.

Member

nox commented Jul 28, 2016

@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Jul 28, 2016

⌛️ Testing commit b4db144 with merge 45209b7...

bors-servo added a commit that referenced this pull request Jul 28, 2016

Auto merge of #12538 - szeged:error-refactor, r=nox
Refactor Bluetooth error handling

<!-- Please describe your changes on the following line: -->
Replace the error messages with an enum in `net/bluetooth_thread.rs`. Rename `bluetooth_blacklist.rs` to `bluetooth_utils.rs` and put the error conversion in it.
With this the returned errors in DOM classes follow the specification.
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because  there is no Web Bluetooth test API implementation yet.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12538)
<!-- Reviewable:end -->
@bors-servo

This comment has been minimized.

Contributor

bors-servo commented Jul 28, 2016

@bors-servo bors-servo merged commit b4db144 into servo:master Jul 28, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment