Added some more error handling
This commit is contained in:
+31
-2
@@ -60,6 +60,10 @@ namespace Test_Merge
|
|||||||
if (Emulator != null)
|
if (Emulator != null)
|
||||||
Emulator.ResetDriver();
|
Emulator.ResetDriver();
|
||||||
|
|
||||||
|
btnStartDecoding.Enabled = false;
|
||||||
|
btnStopUpdating.Enabled = false;
|
||||||
|
btnResetEmulator.Text = "Launch";
|
||||||
|
|
||||||
Emulator = null;
|
Emulator = null;
|
||||||
Wrapper = null;
|
Wrapper = null;
|
||||||
|
|
||||||
@@ -248,8 +252,33 @@ namespace Test_Merge
|
|||||||
|
|
||||||
if (errorCode != 0)
|
if (errorCode != 0)
|
||||||
{
|
{
|
||||||
//IMPLEMENT MORE SPECIFIC ERROR CODES !!
|
string message = "";
|
||||||
MessageBox.Show("An error has occured while trying to start the driver.");
|
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;
|
btnResetEmulator.Enabled = true;
|
||||||
btnSettings.Enabled = true;
|
btnSettings.Enabled = true;
|
||||||
btnResetEmulator.Text = "Retry";
|
btnResetEmulator.Text = "Retry";
|
||||||
|
|||||||
Generated
+1
@@ -182,6 +182,7 @@
|
|||||||
this.tbxDriverName.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
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.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
this.tbxDriverName.Font = new System.Drawing.Font("Microsoft YaHei UI", 11F);
|
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.Location = new System.Drawing.Point(10, 235);
|
||||||
this.tbxDriverName.Name = "tbxDriverName";
|
this.tbxDriverName.Name = "tbxDriverName";
|
||||||
this.tbxDriverName.Size = new System.Drawing.Size(243, 24);
|
this.tbxDriverName.Size = new System.Drawing.Size(243, 24);
|
||||||
|
|||||||
Reference in New Issue
Block a user