mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 13:25:30 +03:00
catch lastError cleanly in current context
This commit is contained in:
parent
893671fa2b
commit
0bd4af89c9
1 changed files with 17 additions and 11 deletions
|
@ -30,7 +30,8 @@ var serial = {
|
|||
switch (info.error) {
|
||||
case 'system_error': // we might be able to recover from this one
|
||||
var crunch_status = function (info) {
|
||||
if (info && !info.paused) {
|
||||
if (info) {
|
||||
if (!info.paused) {
|
||||
console.log('SERIAL: Connection recovered from last onReceiveError');
|
||||
googleAnalytics.sendException('Serial: onReceiveError - recovered', false);
|
||||
} else {
|
||||
|
@ -44,6 +45,11 @@ var serial = {
|
|||
self.disconnect();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (chrome.runtime.lastError) {
|
||||
console.error(chrome.runtime.lastError.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
chrome.serial.setPaused(self.connectionId, false, function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue