Explicitly mention if netstat isn't installed; downgrade to warning

This commit is contained in:
Asher committed 2019-04-08 11:15:25 -05:00
1 parent 6361635b55
commit bbd8b27fc7
1 file changed
+5 -1
+5 -1
View File
@@ -79,7 +79,11 @@ export const createPortScanner = (scanInterval: number = 5000): PortScanner => {
logger.trace("scanning ports");
scan((error) => {
if (error) {
logger.error(`Port scanning will not be available: ${error.message}.`);
if ((error as NodeJS.ErrnoException).code === "ENOENT") {
logger.warn("Port scanning will not be available because netstat is not installed");
} else {
logger.warn(`Port scanning will not be available: ${error.message}`);
}
disposed = true;
} else if (!disposed) {
lastTimeout = setTimeout(doInterval, scanInterval);