mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Exception handling https://github.com/seerge/g-helper/issues/2596
This commit is contained in:
@@ -29,6 +29,8 @@ public class Startup
|
||||
{
|
||||
var task = taskService.RootFolder.AllTasks.FirstOrDefault(t => t.Name == taskName);
|
||||
if (task != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
string strExeFilePath = Application.ExecutablePath.Trim();
|
||||
string action = task.Definition.Actions.FirstOrDefault()!.ToString().Trim();
|
||||
@@ -39,6 +41,11 @@ public class Startup
|
||||
UnSchedule();
|
||||
Schedule();
|
||||
}
|
||||
} catch (Exception ex)
|
||||
{
|
||||
Logger.WriteLine($"Can't check startup task: {ex.Message}");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user