Commit 0d527775 authored by martin hou's avatar martin hou

feat: 调整onerror的触发时机,仅在setup时发生

parent 38c89d05
......@@ -154,7 +154,9 @@ function Jensen(log, conn) {
self.model = determineModel(device.productId);
Logger.info('jensen', 'connect', 'device pid: ' + device.productId);
} catch (e) {
Logger.error('jensen', 'setup', String(e));
let err = String(e);
Logger.error('jensen', 'setup', err);
if (err.indexOf('Unable to claim interface.') > -1) self?.onerror(e);
}
if (!disableOnConnect) _check_conn_status();
current = null;
......@@ -407,7 +409,7 @@ function Jensen(log, conn) {
receive(r);
}).catch((e) => {
console.log('tryReceive error', e)
if (!channelHealthy) self.onerror?.(e);
// if (!channelHealthy) self.onerror?.(e);
});
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment