fix: close device when any error occurred in the communication (#692)

This commit is contained in:
Róbert Kiss
2018-06-24 18:59:13 +02:00
committed by László Monda
parent bd8a2f704f
commit 5234f85dbe

View File

@@ -109,6 +109,7 @@ export class UhkHidDevice {
device.read((err: any, receivedData: Array<number>) => {
if (err) {
this.logService.error('[UhkHidDevice] Transfer error: ', err);
this.close();
return reject(err);
}
const logString = bufferToString(receivedData);