diff options
Diffstat (limited to 'lib/net/protocol.rb')
-rw-r--r-- | lib/net/protocol.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb index 02a469cc0d..01b659f72f 100644 --- a/lib/net/protocol.rb +++ b/lib/net/protocol.rb @@ -68,7 +68,7 @@ Object class Protocol - Version = '1.1.20' + Version = '1.1.21' class << self @@ -295,8 +295,8 @@ Object attr_reader :code_type, :code, :message alias msg message - def error! - raise @code_type.error_type, @code + ' ' + Net.quote(@message) + def error!( data = nil ) + raise code_type.error_type.new( code + ' ' + Net.quote(msg), data ) end end @@ -312,6 +312,17 @@ Object class ProtoRetriableError < ProtocolError; end ProtocRetryError = ProtoRetriableError + class ProtocolError + + def initialize( msg, data ) + super msg + @data = data + end + + attr :data + + end + class Code |