Permalink
Browse files

fixed silent failure when plugin didn't inherit from Scout::Plugin; b…

…eefed up error reporting
  • Loading branch information...
1 parent 66b8756 commit 642a3f7cc5f1753cf0e9733916d95e7efc6bafa3 Andre Lewis committed Dec 16, 2009
Showing with 10 additions and 5 deletions.
  1. +2 −1 bin/scout
  2. +1 −1 lib/scout.rb
  3. +7 −3 lib/scout/server.rb
View
3 bin/scout
@@ -1,7 +1,8 @@
#!/usr/bin/env ruby
+# encoding: utf-8
$VERBOSE = true # -w
-$KCODE = "u" # -Ku
+#$KCODE = "u" # -Ku
$LOAD_PATH << File.join(File.dirname(__FILE__), *%w[.. lib])
require "scout"
View
2 lib/scout.rb
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby -wKU
module Scout
- VERSION = "5.0.1".freeze
+ VERSION = "5.0.2".freeze
end
require "scout/command"
View
10 lib/scout/server.rb
@@ -145,12 +145,13 @@ def run_plugins_by_plan
@plugin_plan.each do |plugin|
begin
process_plugin(plugin)
- rescue RuntimeError
+ rescue Exception
@checkin[:errors] << build_report(
- plugin_id['id'],
+ plugin['id'],
:subject => "Exception: #{$!.message}.",
:body => $!.backtrace
)
+ error("Encountered an error: #{$!.message}")
end
end
take_snapshot if @directives['take_snapshots']
@@ -203,8 +204,11 @@ def process_plugin(plugin)
Timeout.timeout(timeout, PluginTimeoutError) do
data = job.run
end
- rescue Timeout::Error
+ rescue Timeout::Error, PluginTimeoutError
error "Plugin took too long to run."
+ @checkin[:errors] << build_report(plugin['id'],
+ :subject => "Plugin took too long to run",
+ :body=>"Execution timed out.")
return
rescue Exception
raise if $!.is_a? SystemExit

0 comments on commit 642a3f7

Please sign in to comment.