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

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

parent 38c89d05
...@@ -154,7 +154,9 @@ function Jensen(log, conn) { ...@@ -154,7 +154,9 @@ function Jensen(log, conn) {
self.model = determineModel(device.productId); self.model = determineModel(device.productId);
Logger.info('jensen', 'connect', 'device pid: ' + device.productId); Logger.info('jensen', 'connect', 'device pid: ' + device.productId);
} catch (e) { } 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(); if (!disableOnConnect) _check_conn_status();
current = null; current = null;
...@@ -407,7 +409,7 @@ function Jensen(log, conn) { ...@@ -407,7 +409,7 @@ function Jensen(log, conn) {
receive(r); receive(r);
}).catch((e) => { }).catch((e) => {
console.log('tryReceive error', 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