diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-25 21:25:58 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-25 21:25:58 +0000 |
commit | ec3d1be17e63139be117a7a61208bacf9cb01c7e (patch) | |
tree | 6f317a727e10714f6402936d1e0db1d466d905b9 /lib | |
parent | e4f1c2db8337730ca3082844c0a4238a797650d7 (diff) |
Better reporting of plugin failures
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/plugins.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb index befe06ed..2a07cfb0 100644 --- a/lib/rbot/plugins.rb +++ b/lib/rbot/plugins.rb @@ -296,12 +296,12 @@ module Plugins # return help for +topic+ (call associated plugin's help method) def help(topic="") - if topic == "pluginfailures" + if topic =~ /plugin\s*fail(?:ure)?s?\s*(trace(?:back)?s?)?/ # debug "Failures: #{@failed.inspect}" return "no plugins failed to load" if @failed.empty? return (@failed.inject(Array.new) { |list, p| list << "#{Bold}#{p[:name]}#{Bold} failed with #{p[:err].class}: #{p[:err]}" - list << "#{Bold}#{p[:name]}#{Bold} failed at #{p[:err].backtrace.join(', ')}" unless p[:err].backtrace.empty? + list << "#{Bold}#{p[:name]}#{Bold} failed at #{p[:err].backtrace.join(', ')}" if $1 and not p[:err].backtrace.empty? list }).join("\n") end |