re-raise DRbConnError
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a1a2b66e0d
commit
b20531b334
@ -353,13 +353,7 @@ module DRb
|
|||||||
|
|
||||||
# Error raised when an error occurs on the underlying communication
|
# Error raised when an error occurs on the underlying communication
|
||||||
# protocol.
|
# protocol.
|
||||||
class DRbConnError < DRbError
|
class DRbConnError < DRbError; end
|
||||||
def self.new_with_error(cause)
|
|
||||||
conn_error = self.new(cause.message)
|
|
||||||
conn_error.set_backtrace(cause.backtrace)
|
|
||||||
conn_error
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Class responsible for converting between an object and its id.
|
# Class responsible for converting between an object and its id.
|
||||||
#
|
#
|
||||||
@ -558,7 +552,7 @@ module DRb
|
|||||||
begin
|
begin
|
||||||
sz = soc.read(4) # sizeof (N)
|
sz = soc.read(4) # sizeof (N)
|
||||||
rescue
|
rescue
|
||||||
raise(DRbConnError.new_with_error($!))
|
raise(DRbConnError, $!.message, $!.backtrace)
|
||||||
end
|
end
|
||||||
raise(DRbConnError, 'connection closed') if sz.nil?
|
raise(DRbConnError, 'connection closed') if sz.nil?
|
||||||
raise(DRbConnError, 'premature header') if sz.size < 4
|
raise(DRbConnError, 'premature header') if sz.size < 4
|
||||||
@ -567,7 +561,7 @@ module DRb
|
|||||||
begin
|
begin
|
||||||
str = soc.read(sz)
|
str = soc.read(sz)
|
||||||
rescue
|
rescue
|
||||||
raise(DRbConnError.new_with_error($!))
|
raise(DRbConnError, $!.message, $!.backtrace)
|
||||||
end
|
end
|
||||||
raise(DRbConnError, 'connection closed') if sz.nil?
|
raise(DRbConnError, 'connection closed') if sz.nil?
|
||||||
raise(DRbConnError, 'premature marshal format(can\'t read)') if str.size < sz
|
raise(DRbConnError, 'premature marshal format(can\'t read)') if str.size < sz
|
||||||
|
Loading…
x
Reference in New Issue
Block a user