LongoMatch.MainClass.ProcessExecutionError C# (CSharp) Method

ProcessExecutionError() static private method

static private ProcessExecutionError ( Exception ex ) : void
ex System.Exception
return void
		static void ProcessExecutionError (Exception ex)
		{
			if (ex is AddinRequestShutdownException) {
				Application.Quit ();
				return;
			}

			string logFile = Constants.SOFTWARE_NAME + "-" + DateTime.Now + ".log";
			logFile = Utils.SanitizePath (logFile, ' ', ':');
			logFile = Path.Combine (App.Current.HomeDir, logFile);
			Log.Exception (ex);
			try {
				if (File.Exists (logFile)) {
					File.Delete (logFile);
				}
				File.Copy (App.Current.LogFile, logFile);
			} catch (Exception ex1) {
				Log.Exception (ex1);
			}

			MessagesHelpers.ErrorMessage (null,
				Catalog.GetString ("The application has finished with an unexpected error.") + "\n" +
				Catalog.GetString ("A log has been saved at: ") +
				"<a href=\"" + logFile + "\">" + logFile + "</a>\n" +
				Catalog.GetString ("Please, fill a bug report "));
			Application.Quit ();
		}
	}