diff options
author | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2015-08-04 16:38:28 -0400 |
---|---|---|
committer | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2015-08-04 16:38:28 -0400 |
commit | f384bf216caf76efc19309011c3f8e4a598924f9 (patch) | |
tree | 84b4ca3433a6d88294351f82abd3421c3f6e29e9 /lib/chef/exceptions.rb | |
parent | fe6676bab51390429674b0ecd4670924ffb09cc5 (diff) | |
parent | 0f32e154df91b60a7f5981dc029c35e933482fe7 (diff) | |
download | chef-f384bf216caf76efc19309011c3f8e4a598924f9.tar.gz |
Merge pull request #3728 from chef/jdm/win-groups
Rewrite NetLocalGroup things to use FFI
Diffstat (limited to 'lib/chef/exceptions.rb')
-rw-r--r-- | lib/chef/exceptions.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb index 16f985acaa..e3649c068b 100644 --- a/lib/chef/exceptions.rb +++ b/lib/chef/exceptions.rb @@ -129,6 +129,23 @@ class Chef class EnclosingDirectoryDoesNotExist < ArgumentError; end # Errors originating from calls to the Win32 API class Win32APIError < RuntimeError; end + + class Win32NetAPIError < Win32APIError + attr_reader :msg, :error_code + 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 + end + # Thrown when Win32 API layer binds to non-existent Win32 function. Occurs # when older versions of Windows don't support newer Win32 API functions. class Win32APIFunctionNotImplemented < NotImplementedError; end |