Exception: RightScale::Win32Error

Inherits:
Exception
  • Object
show all
Includes:
Windows::Error
Defined in:
lib/right_agent/platform/windows.rb

Overview

Throw when a Win32 API fails. Message will contain the last error message

Instance Method Summary collapse

Constructor Details

#initialize(msg = "") ⇒ Win32Error

Returns a new instance of Win32Error.



45
46
47
48
# File 'lib/right_agent/platform/windows.rb', line 45

def initialize(msg = "")
  super(msg)
  @last_error = get_last_error
end

Instance Method Details

#messageObject



50
51
52
53
54
55
# File 'lib/right_agent/platform/windows.rb', line 50

def message
  original_message = super
  result = ""
  result << "#{original_message}\n  Error Detail: " unless original_message.nil? || original_message.empty?
  result << "#{@last_error}"
end