Closed zinen closed 3 years ago
@zinen try to use catch block on ready, like this:
connection.ready.then(function() {
console.log('Ready');
const device = new huaweiLteApi.Device(connection);
device.signal().then(function(result) {
console.log(result);
}).catch(function(error) {
console.error(error);
});
}).catch(function(error) {
console.log('ERROR in ready');
console.error(error);
});
Yep, that works. Thanks.
I dont understand why the then.catch works and the try/catch doesn't though.
But I can make this work.
Tried running the example code from README.md. But doing so about 5-8 times in a row produces an uncatchable error. The error is thrown by the process "task_queues" and not from inside my the running code.
Tried wrapping the whole code it inside try/catch but that doesn't catch it.
I'm no typescript expert. But can this be fixed to be catchable or can i somehow catch it?
Code:
Error