summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/games/hangman.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/data/rbot/plugins/games/hangman.rb b/data/rbot/plugins/games/hangman.rb
index 7cfd9e69..612b8350 100644
--- a/data/rbot/plugins/games/hangman.rb
+++ b/data/rbot/plugins/games/hangman.rb
@@ -16,6 +16,7 @@ module RandomWord
def self.get(count=1)
res = Net::HTTP.post_form(URI.parse(SITE), {'numwords' => count})
+ raise _("random word generator site failed with #{res.code} - #{res.message}") unless Net::HTTPSuccess === res
words = res.body.scan(%r{<a.*?\?w=(.*?)\n}).flatten
count == 1 ? words.first : words