We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4864236 commit a3ae37aCopy full SHA for a3ae37a
src/gui/usbipd_gui.rs
@@ -201,9 +201,18 @@ impl UsbipdGui {
201
for (menu_item, device) in menu_items.iter() {
202
if handle == menu_item.handle {
203
if device.is_attached() {
204
+ // Silently ignore errors here, as the device may have been unplugged
205
+ // which will have detached it
206
device.detach().ok();
207
} else {
- device.attach().ok();
208
+ device.attach().map_err(|e| {
209
+ nwg::modal_error_message(
210
+ rc_self.window.handle,
211
+ "WSL USB Manager: Attach Error",
212
+ format!("Could not attach device, is it still plugged in?\n\n{}", e)
213
+ .as_str(),
214
+ );
215
+ }).ok();
216
}
217
218
0 commit comments