What's the best practice to recover from a FileSystemWatcher error?

Viewed 7115

After a FileSystemWatcher.Error event was raised, I have no clue about what to do next. The exception can be a [relatively] minor one, such as

too many changes at once in directory

which doesn't affect the watcher's watching process, but it can also be a big issue - such as the watched directory being deleted, in which case the watcher is no longer functional.

My question is what is the best way to handle the Error event?

2 Answers
Related