Skip to content

Commit

Permalink
FlightController: send out error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
stephendade committed Jun 12, 2020
1 parent fb05855 commit 03cc715
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion server/flightController.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,10 @@ class FCDetails {
this.startInterval()
this.saveSerialSettings()
}
return callback(null, this.activeDevice !== null)
return callback(err, this.activeDevice !== null)
})
} else {
// close link
this.activeDevice = null
this.closeLink((err) => {
this.saveSerialSettings()
Expand Down
4 changes: 2 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ app.post('/api/FCModify', [check('device').isJSON(), check('baud').isJSON(), che
if (!err) {
res.setHeader('Content-Type', 'application/json');
//console.log(isSuccess);
res.send(JSON.stringify({telemetryStatus: isSuccess}));
res.send(JSON.stringify({telemetryStatus: isSuccess, error: null}));
}
else {
res.setHeader('Content-Type', 'application/json');
res.send(JSON.stringify({ telemetryStatus: false}));
res.send(JSON.stringify({ telemetryStatus: false, error: err}));
winston.error('Error in /api/FCModify ', { message: err });

}
Expand Down

0 comments on commit 03cc715

Please sign in to comment.