File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ impl DialHapticsWorker {
58
58
eprintln ! ( "haptics worker is ready" ) ;
59
59
60
60
let api = HidApi :: new ( ) . map_err ( Error :: HidError ) ?;
61
- let hid_device = api. open ( 0x045e , 0x091b ) . map_err ( |_| Error :: MissingDial ) ?;
61
+ let hid_device = api. open ( 0x045e , 0x091b ) . map_err ( Error :: HidError ) ?;
62
62
let wrapper = DialHidWrapper { hid_device } ;
63
63
64
64
loop {
Original file line number Diff line number Diff line change @@ -69,8 +69,12 @@ impl DialDevice {
69
69
std:: thread:: spawn ( {
70
70
let mut worker = DialHapticsWorker :: new ( haptics_msg_rx) ?;
71
71
move || {
72
- worker. run ( ) . unwrap ( ) ;
72
+ if let Err ( err) = worker. run ( ) {
73
+ eprintln ! ( "Unexpected haptics worker error! {}" , err) ;
74
+ }
73
75
eprintln ! ( "the haptics worker died!" ) ;
76
+ // there's no coming back from this.
77
+ std:: process:: exit ( 0 ) ;
74
78
}
75
79
} ) ;
76
80
You can’t perform that action at this time.
0 commit comments