[SIGAR-22] Prevent RuntimeException in FileTail impl from killing the FileWatcherThread
This commit is contained in:
1 parent
1c909233b4
commit
e26be5dc38
3 files changed
+11
-2
No files matched your search
@@ -44,7 +44,7 @@ public abstract class FileTail extends FileWatcher {
|
||||
this.useSudo = useSudo;
|
||||
}
|
||||
|
||||
private void error(String name, Throwable exc) {
|
||||
static void error(String name, Throwable exc) {
|
||||
String msg = name + ": " + exc.getMessage();
|
||||
SigarLog.getLogger(FileTail.class.getName()).error(msg, exc);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,11 @@ public class FileWatcherThread implements Runnable {
|
||||
it.hasNext();)
|
||||
{
|
||||
FileWatcher watcher = (FileWatcher)it.next();
|
||||
watcher.check();
|
||||
try {
|
||||
watcher.check();
|
||||
} catch (Exception e) {
|
||||
FileTail.error("Unexception exception", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user