@@ 93,17 93,27 @@ class Process
}
}
+T swallow(T)(lazy T exp, T dVal)
+{
+ try {
+ return exp();
+ }
+ catch (Exception e) {
+ return dVal;
+ }
+}
+
void run()
{
auto now = Clock.currTime();
writef!"%s: running\n"(now.toISOExtString());
auto procs = dirEntries("/proc", SpanMode.shallow, false)
- .filter!(a => a.isDir)
+ .filter!(a => swallow(a.isDir(), false))
.map!(a => baseName(a.name))
.filter!(a => isNumeric(a))
- .map!(a => new Process(to!uint(a)))
- .filter!(a => a.name == TabNineExecutableName)
+ .map!(a => swallow(new Process(to!uint(a)), null))
+ .filter!(a => a !is null && a.name == TabNineExecutableName)
.filter!(a => a.isTooBig)
.array;