diff options
author | Matt Wrock <matt@mattwrock.com> | 2016-02-03 09:58:18 -0800 |
---|---|---|
committer | Matt Wrock <matt@mattwrock.com> | 2016-02-03 09:58:18 -0800 |
commit | b74d0028914b03bce785b940f0cad5390444ae3a (patch) | |
tree | bf1e75773bae697cd469f5e560440e2fd0b5e1c5 /lib/chef/util | |
parent | ab63cd4be967b5d01f6ec856244e4b9af4e896d9 (diff) | |
download | chef-b74d0028914b03bce785b940f0cad5390444ae3a.tar.gz |
fixes #4515 and use FormatMessage to get correct error messages from native API instead of retyping them with our fingersinvalid
Diffstat (limited to 'lib/chef/util')
-rw-r--r-- | lib/chef/util/windows/net_group.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/chef/util/windows/net_group.rb b/lib/chef/util/windows/net_group.rb index f1c510591e..cfb06ed1f1 100644 --- a/lib/chef/util/windows/net_group.rb +++ b/lib/chef/util/windows/net_group.rb @@ -37,40 +37,40 @@ class Chef::Util::Windows::NetGroup def local_get_members begin Chef::ReservedNames::Win32::NetUser::net_local_group_get_members(nil, groupname) - rescue Chef::Exceptions::Win32NetAPIError => e - raise ArgumentError, e.msg + rescue Chef::Exceptions::Win32APIError => e + raise ArgumentError, e end end def local_add begin Chef::ReservedNames::Win32::NetUser::net_local_group_add(nil, groupname) - rescue Chef::Exceptions::Win32NetAPIError => e - raise ArgumentError, e.msg + rescue Chef::Exceptions::Win32APIError => e + raise ArgumentError, e end end def local_set_members(members) begin Chef::ReservedNames::Win32::NetUser::net_local_group_set_members(nil, groupname, members) - rescue Chef::Exceptions::Win32NetAPIError => e - raise ArgumentError, e.msg + rescue Chef::Exceptions::Win32APIError => e + raise ArgumentError, e end end def local_add_members(members) begin Chef::ReservedNames::Win32::NetUser::net_local_group_add_members(nil, groupname, members) - rescue Chef::Exceptions::Win32NetAPIError => e - raise ArgumentError, e.msg + rescue Chef::Exceptions::Win32APIError => e + raise ArgumentError, e end end def local_delete_members(members) begin Chef::ReservedNames::Win32::NetUser::net_local_group_del_members(nil, groupname, members) - rescue Chef::Exceptions::Win32NetAPIError => e - raise ArgumentError, e.msg + rescue Chef::Exceptions::Win32APIError => e + raise ArgumentError, e end end @@ -78,8 +78,8 @@ class Chef::Util::Windows::NetGroup def local_delete begin Chef::ReservedNames::Win32::NetUser::net_local_group_del(nil, groupname) - rescue Chef::Exceptions::Win32NetAPIError => e - raise ArgumentError, e.msg + rescue Chef::Exceptions::Win32APIError => e + raise ArgumentError, e end end end |