Permalink
Browse files

updated install text; enabled better error message when user provides…

… incorrect server key
  • Loading branch information...
1 parent 2068ac3 commit 309e9c30e3e545b307f5a67437b53dc820f33fb6 Andre Lewis committed Dec 10, 2009
Showing with 9 additions and 7 deletions.
  1. +7 −6 lib/scout/command/install.rb
  2. +2 −1 lib/scout/server.rb
@@ -11,18 +11,18 @@ def run
puts <<-END_INTRO.gsub(/^ {8}/, "")
=== Scout Installation Wizard ===
- You need the Client Key displayed in the Client Settings tab.
+ You need the Server Key displayed in the Server Settings tab.
It looks like:
6ecad322-0d17-4cb8-9b2c-a12c4541853f
- Enter the Client Key:
+ Enter the Server Key:
END_INTRO
key = gets.to_s.strip
puts "\nAttempting to contact the server..."
begin
- Scout::Server.new(server, key, history, log) { |scout| scout.test }
+ Scout::Server.new(server, key, history, log) { |scout| scout.fetch_plan }
puts <<-END_SUCCESS.gsub(/^ {10}/, "")
Success!
@@ -33,14 +33,14 @@ def run
(usually located at /etc/crontab):
****** START CRONTAB SAMPLE ******
- */30 * * * * #{user} #{program_path} #{key}
+ * * * * * #{user} #{program_path} #{key}
****** END CRONTAB SAMPLE ******
If you are using this current user's crontab
(using crontab -e to edit):
****** START CRONTAB SAMPLE ******
- */30 * * * * #{program_path} #{key}
+ * * * * * #{program_path} #{key}
****** END CRONTAB SAMPLE ******
For help setting up Scout with crontab, please visit:
@@ -49,9 +49,10 @@ def run
END_SUCCESS
rescue SystemExit
+ puts $!.message
puts <<-END_ERROR.gsub(/^ {10}/, "")
- Could not contact server. The client key may be incorrect.
+ Could not contact server.
For more help, please visit:
http://scoutapp.com/help
View
@@ -360,8 +360,9 @@ def request(url, response_handler, error, &connector)
when Net::HTTPSuccess, Net::HTTPNotModified
response_handler[response] unless response_handler.nil?
else
+ error = "Server says: #{response['x-scout-msg']}" if response['x-scout-msg']
fatal error
- exit
+ raise SystemExit.new(error)
end
rescue Timeout::Error
fatal "Request timed out."

0 comments on commit 309e9c3

Please sign in to comment.