class PosixPsutil::AccessDenied

Raise it when the access is denied, a wrapper of ENOENT::EACCES

Public Class Methods

new(opt={}) click to toggle source
# File psutil_error.rb, line 33
def initialize(opt={})
  @pid = opt[:pid] || nil
  @name = opt[:name] || nil
  if opt[:msg].nil?
    if @pid && @name
      details = "(pid=#{@pid}, name=#{@name.to_s})"
    elsif @pid
      details = "(pid=#{@pid})"
    else
      details = ""
    end
    opt[:msg] = "access is denied " + details
  end
  @message = opt[:msg]
end