summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Asuncion <jeunito@gmail.com>2017-07-04 20:02:49 -0700
committerJose Asuncion <jeunito@gmail.com>2017-07-04 20:19:01 -0700
commita0bea2e9366c148337f89b536be8f78f7475f6c1 (patch)
treef4c4aa867fdae1c55cdee2e78dadf6d9b7b93d13
parent02a46911341c1d5ef10309d27963031d598dbe2c (diff)
downloadchef-a0bea2e9366c148337f89b536be8f78f7475f6c1.tar.gz
format NotAChefServerException nicely
Signed-off-by: Jose Asuncion <jeunito@gmail.com>
-rw-r--r--lib/chef/knife.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb
index aa30f2e2ed..46d315aacf 100644
--- a/lib/chef/knife.rb
+++ b/lib/chef/knife.rb
@@ -474,6 +474,8 @@ class Chef
when Chef::Exceptions::InvalidRedirect
ui.error "Invalid Redirect: #{e.message}"
ui.info "Change your server location in knife.rb to the server's FQDN to avoid unwanted redirections."
+ when Chef::Exceptions::NotAChefServerException
+ ui.error "Argument Error: #{Chef::Config[:chef_server_url]} is not a valid chef server"
else
ui.error "#{e.class.name}: #{e.message}"
end