mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 09:23:19 +01:00
fix(simulator): add better error message when virtual device creation fails
This commit is contained in:
@@ -2,7 +2,6 @@ use std::env;
|
||||
use std::error::Error;
|
||||
use std::str::FromStr;
|
||||
|
||||
use log::error;
|
||||
use rog_anime::usb::{PROD_ID, VENDOR_ID};
|
||||
use rog_anime::{AnimeType, USB_PREFIX2};
|
||||
use sdl2::event::Event;
|
||||
@@ -87,8 +86,12 @@ impl VirtAnimeMatrix {
|
||||
]
|
||||
.to_vec(),
|
||||
})
|
||||
.map_err(|err| error!("Could not create virtual device: {:?}", err))
|
||||
.expect("Could not create virtual device"),
|
||||
.unwrap_or_else(|err| {
|
||||
panic!(
|
||||
"Could not create virtual device: {err:?}. \
|
||||
Try loading the uhid module and ensure you have the necessary permissions."
|
||||
)
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user