diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-26 23:14:00 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-26 23:14:00 +0000 |
commit | 8aae94a93dd5231a2f910e9f984f56306aea42af (patch) | |
tree | 8b6ae32688e8935fa9a1e6d54c5bdaa29b892c83 /data/rbot | |
parent | bec899cdd86308a672399020d0bafb4369f38a4b (diff) |
weather plugin now reports error met when displaying info instead of silently erroring out
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/weather.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/data/rbot/plugins/weather.rb b/data/rbot/plugins/weather.rb index 3570aa8e..e6284e45 100644 --- a/data/rbot/plugins/weather.rb +++ b/data/rbot/plugins/weather.rb @@ -85,11 +85,12 @@ class MyWeatherPlugin < Plugin met = CurrentConditions.new(where) end if met - # begin - m.reply met.update - @cc_cache[where] = met - # rescue - # end + begin + m.reply met.update + @cc_cache[where] = met + rescue => e + m.reply e.message + end else m.reply "couldn't find weather data for #{where}" end @@ -109,5 +110,6 @@ class MyWeatherPlugin < Plugin end end end + plugin = MyWeatherPlugin.new plugin.map 'weather :where', :defaults => {:where => false} |