catch SigarException so loop doesnt break

This commit is contained in:
Doug MacEachern 2004-07-28 03:47:56 +00:00
parent a233f13a6c
commit 73b6f54d7e
1 changed files with 6 additions and 3 deletions

View File

@ -32,7 +32,12 @@ public class ShowArgs extends SigarCommandBase {
long[] pids = this.shell.findPids(args); long[] pids = this.shell.findPids(args);
for (int i=0; i<pids.length; i++) { for (int i=0; i<pids.length; i++) {
try {
println("pid=" + pids[i]);
output(pids[i]); output(pids[i]);
} catch (SigarException e) {
println(e.getMessage());
}
println("\n------------------------\n"); println("\n------------------------\n");
} }
} }
@ -41,8 +46,6 @@ public class ShowArgs extends SigarCommandBase {
String[] argv = this.proxy.getProcArgs(pid); String[] argv = this.proxy.getProcArgs(pid);
println("pid=" + pid);
try { try {
String exe = this.proxy.getProcExe(pid).getName(); String exe = this.proxy.getProcExe(pid).getName();
println("exe=" + exe); println("exe=" + exe);