Do not display exceptions stack trace when trying to stop already stopped daemons, fixes
*/
package org.jboss.fuse.mvnd.daemon;
+import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -92,10 +93,17 @@ public class Client {
if (dis.length > 0) {
System.out.println("Stopping " + dis.length + " running daemons");
for (DaemonInfo di : dis) {
+ try {
new ProcessImpl(di.getPid()).destroy();
+ } catch (IOException t) {
+ System.out.println("Daemon " + di.getUid() + ": " + t.getMessage());
+ } catch (Exception t) {
+ System.out.println("Daemon " + di.getUid() + ": " + t);
+ } finally {
registry.remove(di.getUid());
}
}
+ }
return;
}
