I am using HID to write data to a microcontroller and it works perfectly upon start-up allowing me to send the data. However, sometimes I receive the error message "hid_write/GetOverlappedResult: (0x000003E3) the I/O operation has been aborted because of either a thread exit or an application request." and the program exits. I understand this is due to using unwrap(), but I want to handle this error and I am not sure how to interpret the presented error.
When I restart the program, it is able to connect and transmit successfully. However, the error will eventually show up again, causing the program to exit. It is unclear when the error will occur, but it happens consistently.