1
0
Fork 0
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:
cTn 2014-09-01 14:56:13 +02:00
parent 893671fa2b
commit 0bd4af89c9

View file

@ -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 () {