AnkiNodeDrive
AnkiNodeDrive copied to clipboard
UnhandledPromiseRejectionWarning
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!