I'm trying to figure out how to catch any error that occurs from calling this Sikuli script. It launches a Sikuli script which performs numerous tasks and generally runs for about two hours. If any error occurs from it during that time, I need to be able to detect it and then re-run the script. I know how to re-run the script, but I'm not sure how to detect if an error occurred while it was running.
Process Sikulix_Login_Process = new Process();
ProcessStartInfo Sikulix_Login_StartInfo = new ProcessStartInfo();
Sikulix_Login_StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
Sikulix_Login_StartInfo.FileName = "cmd.exe";
Sikulix_Login_StartInfo.Arguments = "/c java -jar \"PathToSikuliJarFile\" -r \"PathToSikuliScript\"";
Sikulix_Login_Process.StartInfo = Sikulix_Login_StartInfo;
Sikulix_Login_Process.Start();