Skip to content

the application crashes when a configured action could not be started #5

Description

@fguchelaar

If, for some reason, the command-file that should be launched cannot be found, the application crashes:

Unhandled Exception: System.ComponentModel.Win32Exception: The system cannot find the file specified
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at FSWActions.Core.Watcher.ProcessEvent(FileSystemEventArgs fileSystemEventArgs, ActionConfig actionConfig)
   at FSWActions.Core.Watcher.<>c__DisplayClassc.<>c__DisplayClass10.<StartWatching>b__3()
   at FSWActions.Core.Watcher.Debounce(String key, Action action)
   at FSWActions.Core.Watcher.<>c__DisplayClassc.<StartWatching>b__2(Object sender, FileSystemEventArgs args)
   at System.IO.FileSystemWatcher.OnChanged(FileSystemEventArgs e)
   at System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(Int32 action, String name)
   at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

The preferred approach would be to log it as an error, but keep on running, to server other watches.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions