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

Add find_device function #56

Merged
merged 5 commits into from
Nov 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Check if client is none in find_device function
  • Loading branch information
yukibtc committed Nov 15, 2022
commit 80da236828a64c9fb415f4c1eb4ff2408c7af69e
5 changes: 5 additions & 0 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ impl HWIClient {
.commands
.getattr(py, "find_device")?
.call1(py, client_args)?;

if client.is_none(py) {
return Err(Error::Utf8("Device not found".to_string()));
Copy link
Member

Choose a reason for hiding this comment

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

nit: I think this should be a Error::HWIError

}

Ok(HWIClient {
hwilib: libs,
hw_client: client,
Expand Down