Better serial port error handling