better permission denied message

This commit is contained in:
Doug MacEachern 2004-08-18 16:05:31 +00:00
parent 9c866c1369
commit 641253b359
1 changed files with 3 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package net.hyperic.sigar.cmd;
import net.hyperic.sigar.Sigar; import net.hyperic.sigar.Sigar;
import net.hyperic.sigar.SigarException; import net.hyperic.sigar.SigarException;
import net.hyperic.sigar.SigarPermissionDeniedException;
import net.hyperic.sigar.ProcFd; import net.hyperic.sigar.ProcFd;
import net.hyperic.sigar.ProcExe; import net.hyperic.sigar.ProcExe;
@ -36,6 +37,8 @@ public class ProcFileInfo extends SigarCommandBase {
for (int i=0; i<pids.length; i++) { for (int i=0; i<pids.length; i++) {
try { try {
output(pids[i]); output(pids[i]);
} catch (SigarPermissionDeniedException e) {
println(this.shell.getUserDeniedMessage(pids[i]));
} catch (SigarException e) { } catch (SigarException e) {
println("(" + e.getMessage() + ")"); println("(" + e.getMessage() + ")");
} }