lib/chef/knife/winrm_session.rb in knife-windows-1.8.0 vs lib/chef/knife/winrm_session.rb in knife-windows-1.9.0
- old
+ new
@@ -71,9 +71,12 @@
print_data(@host, stderr, :red) if stderr
end
end
@exit_code = session_result.exitcode
session_result
+ rescue WinRM::WinRMHTTPTransportError, WinRM::WinRMAuthorizationError => e
+ @exit_code = 401
+ raise e
end
private
def print_data(host, data, color = :cyan)