Skip to content

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

Merged
cwfitzgerald merged 2 commits intogfx-rs:trunkfrom
bradwerth:deviceLostOnInvalid
Oct 14, 2023
Merged

Use DeviceError::Lost to represent device loss.#4238
cwfitzgerald merged 2 commits intogfx-rs:trunkfrom
bradwerth:deviceLostOnInvalid

Conversation

@bradwerth
Copy link
Copy Markdown
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
Copy Markdown
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
@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