Exception: Chef::Exceptions::Win32NetAPIError

Inherits:
Win32APIError
  • Object
show all
Defined in:
lib/chef/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, error_code) ⇒ Win32NetAPIError

Returns a new instance of Win32NetAPIError.



137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/chef/exceptions.rb', line 137

def initialize(msg, error_code)
  @msg = msg
  @error_code = error_code

  formatted_message = ""
  formatted_message << "---- Begin Win32 API output ----\n"
  formatted_message << "Net Api Error Code: #{error_code}\n"
  formatted_message << "Net Api Error Message: #{msg}\n"
  formatted_message << "---- End Win32 API output ----\n"

  super(formatted_message)
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



136
137
138
# File 'lib/chef/exceptions.rb', line 136

def error_code
  @error_code
end

#msgObject (readonly)

Returns the value of attribute msg.



136
137
138
# File 'lib/chef/exceptions.rb', line 136

def msg
  @msg
end