]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/rfc2812.rb
Better handling of akills and other form of disconnections
[user/henk/code/ruby/rbot.git] / lib / rbot / rfc2812.rb
index 335da2ea5820f0a24917c3ba72f96bcf16ddfdf2..0839d1d52593db514d4458a92c19b57c4c6c7b1a 100644 (file)
@@ -6,6 +6,9 @@
 # This module defines the Irc::Client class, a class that can handle and
 # dispatch messages based on RFC 2821 (Internet Relay Chat: Client Protocol)
 
+class ServerMessageParseError < ServerError
+end
+
 module Irc
   # - The server sends Replies 001 to 004 to a user upon
   #   successful registration.
@@ -1033,7 +1036,7 @@ module Irc
       data[:serverstring] = serverstring
 
       unless serverstring.chomp =~ /^(:(\S+)\s)?(\S+)(\s(.*))?$/
-        raise ServerError, "Unparseable Server Message!!!: #{serverstring.inspect}"
+        raise ServerMessageParseError, (serverstring.chomp rescue serverstring)
       end
 
       prefix, command, params = $2, $3, $5