class PosixPsutil::NoSuchProcess

Raise it if the process behind doesn't exist when you try to call a method of a Process instance.

Public Class Methods

new(opt={}) click to toggle source

should be used at least like ::new(pid: xxx)

# File psutil_error.rb, line 13
def initialize(opt={})
  raise ArgumentError if opt[:pid].nil?
  @pid = opt[:pid] # pid must given
  @name = opt[:name] || nil
  if opt[:msg].nil?
    if @name
      details = "(pid=#{@pid}, name=#{@name.to_s})"
    else
      details = "(pid=#{@pid})"
    end
    opt[:msg] = "process no longer exists " + details
  end
  @message = opt[:msg]
end