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

Use DeviceError::Lost to represent device loss. #4238

Merged
merged 2 commits into from
Oct 14, 2023

Conversation

bradwerth
Copy link
Contributor

@bradwerth bradwerth commented Oct 13, 2023

The device.valid boolean, regardless of its name, represents a state that is only activated through "lose the device". This patch changes error reporting of an invalid/lost device to use DeviceError::Lost. The value DeviceError::Invalid is used when a device id is not found.

Checklist

  • Run cargo clippy.
  • Run cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
None

Description
This separates the meaning of DeviceError::Invalid (unknown device id) from DeviceError::Lost (device known and lost).

Testing
There is no real testing of this. The test device_destroy_then_more is making calls that result in a DeviceError::Lost value, but the test infrastructure checks for any failure, not a specific error type.

The device.valid boolean, regardless of its name, represents a state
that is only activated through "lose the device". This patch changes
error reporting of an invalid/lost device to use DeviceError::Lost. The
value DeviceError::Invalid is used when a device id is not found.
@bradwerth bradwerth requested a review from a team as a code owner October 13, 2023 20:14
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Noice

@cwfitzgerald cwfitzgerald merged commit 5034756 into gfx-rs:trunk Oct 14, 2023
23 checks passed
@bradwerth bradwerth deleted the deviceLostOnInvalid branch October 16, 2023 15:47
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.

2 participants