aboutsummaryrefslogtreecommitdiffstats
path: root/lib/net/protocol.rb
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-09 07:53:59 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-09 07:53:59 +0000
commitfdd3d8551ffbb1a805b5cd559314ed4be7e1c03c (patch)
treecea1bdbed8b282192c55826328f1959ec3c81a7e /lib/net/protocol.rb
parenteb4c6c241d2032ac858c481b35de72dee28bad74 (diff)
downloadruby-fdd3d8551ffbb1a805b5cd559314ed4be7e1c03c.tar.gz
o protocol.rb: ProtocolError can take data
o http.rb: raise exception with response git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/protocol.rb')
-rw-r--r--lib/net/protocol.rb17
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