summaryrefslogtreecommitdiff
path: root/rbot/plugins
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-07-21 11:40:21 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-07-21 11:40:21 +0000
commit3ba6917c904f5e664ae78b146f4e394ad805eb96 (patch)
tree8eb019c73ce269ab83970cc29d03266d041f092b /rbot/plugins
parentbd3621d2e107924e4620a981b34bd351c4a7e8e1 (diff)
bit of error checking/reporting
Diffstat (limited to 'rbot/plugins')
-rw-r--r--rbot/plugins/slashdot.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/rbot/plugins/slashdot.rb b/rbot/plugins/slashdot.rb
index 38005bde..b09ac7a7 100644
--- a/rbot/plugins/slashdot.rb
+++ b/rbot/plugins/slashdot.rb
@@ -33,7 +33,13 @@ class SlashdotPlugin < Plugin
m.reply "search for #{search} failed"
return
end
- doc = Document.new xml
+ begin
+ doc = Document.new xml
+ rescue REXML::ParseException => e
+ puts e
+ m.reply "couldn't parse output XML: #{e.class}"
+ return
+ end
unless doc
m.reply "search for #{search} failed"
return
@@ -58,7 +64,7 @@ class SlashdotPlugin < Plugin
end
doc = Document.new xml
unless doc
- m.reply "slashdot news parse failed"
+ m.reply "slashdot news parse failed (invalid xml)"
return
end
done = 0