Added some more error handling

This commit is contained in:
2023-05-25 14:29:45 +02:00
parent c105382269
commit 6f36c829c2
2 changed files with 32 additions and 2 deletions
+31 -2
View File
@@ -60,6 +60,10 @@ namespace Test_Merge
if (Emulator != null)
Emulator.ResetDriver();
btnStartDecoding.Enabled = false;
btnStopUpdating.Enabled = false;
btnResetEmulator.Text = "Launch";
Emulator = null;
Wrapper = null;
@@ -248,8 +252,33 @@ namespace Test_Merge
if (errorCode != 0)
{
//IMPLEMENT MORE SPECIFIC ERROR CODES !!
MessageBox.Show("An error has occured while trying to start the driver.");
string message = "";
switch (errorCode)
{
case 101:
message = "Error " + errorCode + " Could not start the driver. It could be because an other instance is runnin make sure you closed them all before trying again";
break;
case 102:
message = "Error " + errorCode + " Could not navigate on the F1TV site. Make sure the correct URL has been given and that you logged from chrome. It can take a few minutes to update";
break;
case 103:
message = "Error " + errorCode + " The url is not a valid url";
break;
case 104:
message = "Error " + errorCode + " The url is not a valid url";
break;
case 105:
message = "Error " + errorCode + " There has been an error trying to emulate button presses. Please try again";
break;
case 106:
message = "Error " + errorCode + " There has been an error trying to emulate button presses. Please try again";
break;
default:
message = "Could not start the emulator Error " + errorCode;
break;
}
MessageBox.Show(message);
btnResetEmulator.Enabled = true;
btnSettings.Enabled = true;
btnResetEmulator.Text = "Retry";
+1
View File
@@ -182,6 +182,7 @@
this.tbxDriverName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
this.tbxDriverName.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.tbxDriverName.Font = new System.Drawing.Font("Microsoft YaHei UI", 11F);
this.tbxDriverName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252)))));
this.tbxDriverName.Location = new System.Drawing.Point(10, 235);
this.tbxDriverName.Name = "tbxDriverName";
this.tbxDriverName.Size = new System.Drawing.Size(243, 24);