Method: ReservedNames::Win32::Error.raise!
- Defined in:
- lib/chef/win32/error.rb
.raise!(message = nil) ⇒ Object
Raises the last error. This should only be called by Win32 API wrapper functions, and then only when wrapped in an if() statement (since it unconditionally exits)
Returns
- nil:
-
always returns nil when it does not raise
Raises
- Chef::Exceptions::Win32APIError:
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/chef/win32/error.rb', line 60 def self.raise!( = nil) code = get_last_error msg = (code).strip = "" << if << "---- Begin Win32 API output ----\n" << "System Error Code: #{code}\n" << "System Error Message: #{msg}\n" << "---- End Win32 API output ----\n" raise Chef::Exceptions::Win32APIError, msg + "\n" + end |