X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Frbot%2Frfc2812.rb;h=0839d1d52593db514d4458a92c19b57c4c6c7b1a;hb=fa639cb4885f63e887493afbd4e0dbacbe4a0e99;hp=cd32135af933f51e1203c410a246a9674fd54e18;hpb=88590b85a4dcd20a91b9844dfff353996bc81119;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/rfc2812.rb b/lib/rbot/rfc2812.rb index cd32135a..0839d1d5 100644 --- a/lib/rbot/rfc2812.rb +++ b/lib/rbot/rfc2812.rb @@ -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 "Unparseable Server Message!!!: #{serverstring.inspect}" + raise ServerMessageParseError, (serverstring.chomp rescue serverstring) end prefix, command, params = $2, $3, $5