Skip to content

Commit

Permalink
JumpTag: handle exceptions from comPort.doCommand()
Browse files Browse the repository at this point in the history
magicrub authored and meee1 committed Apr 27, 2023
1 parent 721c2bd commit 8eca489
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions GCSViews/FlightData.cs
Original file line number Diff line number Diff line change
@@ -6189,9 +6189,15 @@ private void jumpToTagToolStripMenuItem_Click(object sender, EventArgs e)
return;
}

if (!MainV2.comPort.doCommand(MAVLink.MAV_CMD.DO_JUMP_TAG, tag, 0, 0, 0, 0, 0, 0))
try {
if (!MainV2.comPort.doCommand(MAVLink.MAV_CMD.DO_JUMP_TAG, tag, 0, 0, 0, 0, 0, 0))
{
CustomMessageBox.Show(Strings.CommandFailed, Strings.ERROR);
}
}
catch (Exception ex)
{
CustomMessageBox.Show(Strings.CommandFailed, Strings.ERROR);
CustomMessageBox.Show(Strings.CommandFailed + ex.ToString(), Strings.ERROR);
}
}
}

0 comments on commit 8eca489

Please sign in to comment.