AnkiNodeDrive icon indicating copy to clipboard operation
AnkiNodeDrive copied to clipboard

UnhandledPromiseRejectionWarning

Open ThomasHeinrichSchmidt opened this issue 6 years ago • 0 comments

I'm trying to use your server.js from a Python script and that seem to be working somehow. But I do not receive reasonable error handling if something as simple as an unconnected car happens.

Connect to car: Ground Shock
(node:3128) UnhandledPromiseRejectionWarning: TypeError: connectCar(...).then is not a function
    at /home/pi/Projects/AnkiNodeDrive/ankiNodeUtils.js:307:25

I tried to fix it in function getReaderCharacteristic(carName) using a catch() like below but it did not help.

  reject(readerCharacteristic);
  return;
}).catch((error) => {
	// assert.isNotOk(error,'Promise error');
	return;
});

Can you help? I'm hoping to use your server for driving the cars using a keyboard (WASD + cursor keys :-) Driving and lights is very nice!

ThomasHeinrichSchmidt avatar Jan 17 '19 18:01 ThomasHeinrichSchmidt