Skip to content

Commit

Permalink
Expanded exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalZywerKNEI committed Mar 20, 2023
1 parent 38e7aca commit 2bf869e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
14 changes: 12 additions & 2 deletions MiniRoverInterfaceCs/Interface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private void BtnSave_Click(object sender, EventArgs e)
}
else
{
MessageBox.Show(@"Select different and not empty Send and Recieve Ports.");
MessageBox.Show(@"Select different and not empty Send and Recieve Ports");
}
}

Expand All @@ -64,8 +64,18 @@ private void BtnConnect_Click(object sender, EventArgs e)
//SerialPortRecieve.PortName = TxtRecievePort.Text;
SerialPortSend.PortName = TxtSendPort.Text;

try
{
SerialPortSend.Open();
}
catch (Exception ConnectException)
{
MessageBox.Show($"Error while trying to connect: {ConnectException.Message}");
}


//SerialPortRecieve.Open();
SerialPortSend.Open();

/*try
{
RecieveThread = new Thread(SerialPortRecieveRead);
Expand Down
4 changes: 2 additions & 2 deletions MiniRoverInterfaceCs/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]
[assembly: AssemblyVersion("1.3.1.1")]
[assembly: AssemblyFileVersion("1.3.1.1")]
2 changes: 1 addition & 1 deletion MiniRoverInterfaceCs/SerialRecieveSend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void SerialSend()
}
catch (Exception SendException)
{
MessageBox.Show(@"Ayo bruh: " + SendException.Message);
MessageBox.Show($"Error while sending data: {SendException.Message}");
}
}
}
Expand Down

0 comments on commit 2bf869e

Please sign in to comment.